diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index bfb4ea196e308..04fc8d243cb86 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -430,6 +430,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-appplatform-generated;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 076a91a0a6e1d..78fcefde596bb 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,7 @@ sdk/appconfiguration sdk/appcontainers sdk/applicationinsights + sdk/appplatform sdk/attestation sdk/automanage sdk/automation diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/CHANGELOG.md b/sdk/appplatform/azure-resourcemanager-appplatform-generated/CHANGELOG.md new file mode 100644 index 0000000000000..359c90eaac328 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-09-21) + +- Azure Resource Manager AppPlatform client library for Java. This package contains Microsoft Azure SDK for AppPlatform Management SDK. REST API for Azure Spring Apps. Package tag package-preview-2023-11. 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/appplatform/azure-resourcemanager-appplatform-generated/README.md b/sdk/appplatform/azure-resourcemanager-appplatform-generated/README.md new file mode 100644 index 0000000000000..02297583f2c40 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager AppPlatform client library for Java + +Azure Resource Manager AppPlatform client library for Java. + +This package contains Microsoft Azure SDK for AppPlatform Management SDK. REST API for Azure Spring Apps. Package tag package-preview-2023-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-appplatform-generated;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-appplatform-generated + 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(); +AppPlatformManager manager = AppPlatformManager + .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/appplatform/azure-resourcemanager-appplatform-generated/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%2Fappplatform%2Fazure-resourcemanager-appplatform-generated%2FREADME.png) diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/SAMPLE.md b/sdk/appplatform/azure-resourcemanager-appplatform-generated/SAMPLE.md new file mode 100644 index 0000000000000..042bb08b442f7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/SAMPLE.md @@ -0,0 +1,5263 @@ +# Code snippets and samples + + +## ApiPortalCustomDomains + +- [CreateOrUpdate](#apiportalcustomdomains_createorupdate) +- [Delete](#apiportalcustomdomains_delete) +- [Get](#apiportalcustomdomains_get) +- [List](#apiportalcustomdomains_list) + +## ApiPortals + +- [CreateOrUpdate](#apiportals_createorupdate) +- [Delete](#apiportals_delete) +- [Get](#apiportals_get) +- [List](#apiportals_list) +- [ValidateDomain](#apiportals_validatedomain) + +## Apms + +- [CreateOrUpdate](#apms_createorupdate) +- [Delete](#apms_delete) +- [Get](#apms_get) +- [List](#apms_list) +- [ListSecretKeys](#apms_listsecretkeys) + +## ApplicationAccelerators + +- [CreateOrUpdate](#applicationaccelerators_createorupdate) +- [Delete](#applicationaccelerators_delete) +- [Get](#applicationaccelerators_get) +- [List](#applicationaccelerators_list) + +## ApplicationLiveViews + +- [CreateOrUpdate](#applicationliveviews_createorupdate) +- [Delete](#applicationliveviews_delete) +- [Get](#applicationliveviews_get) +- [List](#applicationliveviews_list) + +## Apps + +- [CreateOrUpdate](#apps_createorupdate) +- [Delete](#apps_delete) +- [Get](#apps_get) +- [GetResourceUploadUrl](#apps_getresourceuploadurl) +- [List](#apps_list) +- [SetActiveDeployments](#apps_setactivedeployments) +- [Update](#apps_update) +- [ValidateDomain](#apps_validatedomain) + +## Bindings + +- [CreateOrUpdate](#bindings_createorupdate) +- [Delete](#bindings_delete) +- [Get](#bindings_get) +- [List](#bindings_list) +- [Update](#bindings_update) + +## BuildService + +- [CreateOrUpdate](#buildservice_createorupdate) +- [CreateOrUpdateBuild](#buildservice_createorupdatebuild) +- [DeleteBuild](#buildservice_deletebuild) +- [GetBuild](#buildservice_getbuild) +- [GetBuildResult](#buildservice_getbuildresult) +- [GetBuildResultLog](#buildservice_getbuildresultlog) +- [GetBuildService](#buildservice_getbuildservice) +- [GetResourceUploadUrl](#buildservice_getresourceuploadurl) +- [GetSupportedBuildpack](#buildservice_getsupportedbuildpack) +- [GetSupportedStack](#buildservice_getsupportedstack) +- [ListBuildResults](#buildservice_listbuildresults) +- [ListBuildServices](#buildservice_listbuildservices) +- [ListBuilds](#buildservice_listbuilds) +- [ListSupportedBuildpacks](#buildservice_listsupportedbuildpacks) +- [ListSupportedStacks](#buildservice_listsupportedstacks) + +## BuildServiceAgentPool + +- [Get](#buildserviceagentpool_get) +- [List](#buildserviceagentpool_list) +- [UpdatePut](#buildserviceagentpool_updateput) + +## BuildServiceBuilder + +- [CreateOrUpdate](#buildservicebuilder_createorupdate) +- [Delete](#buildservicebuilder_delete) +- [Get](#buildservicebuilder_get) +- [List](#buildservicebuilder_list) +- [ListDeployments](#buildservicebuilder_listdeployments) + +## BuildpackBinding + +- [CreateOrUpdate](#buildpackbinding_createorupdate) +- [Delete](#buildpackbinding_delete) +- [Get](#buildpackbinding_get) +- [List](#buildpackbinding_list) +- [ListForCluster](#buildpackbinding_listforcluster) + +## Certificates + +- [CreateOrUpdate](#certificates_createorupdate) +- [Delete](#certificates_delete) +- [Get](#certificates_get) +- [List](#certificates_list) + +## ConfigServers + +- [Get](#configservers_get) +- [UpdatePatch](#configservers_updatepatch) +- [UpdatePut](#configservers_updateput) +- [Validate](#configservers_validate) + +## ConfigurationServices + +- [CreateOrUpdate](#configurationservices_createorupdate) +- [Delete](#configurationservices_delete) +- [Get](#configurationservices_get) +- [List](#configurationservices_list) +- [Validate](#configurationservices_validate) +- [ValidateResource](#configurationservices_validateresource) + +## ContainerRegistries + +- [CreateOrUpdate](#containerregistries_createorupdate) +- [Delete](#containerregistries_delete) +- [Get](#containerregistries_get) +- [List](#containerregistries_list) +- [Validate](#containerregistries_validate) + +## CustomDomains + +- [CreateOrUpdate](#customdomains_createorupdate) +- [Delete](#customdomains_delete) +- [Get](#customdomains_get) +- [List](#customdomains_list) +- [Update](#customdomains_update) + +## CustomizedAccelerators + +- [CreateOrUpdate](#customizedaccelerators_createorupdate) +- [Delete](#customizedaccelerators_delete) +- [Get](#customizedaccelerators_get) +- [List](#customizedaccelerators_list) +- [Validate](#customizedaccelerators_validate) + +## Deployments + +- [CreateOrUpdate](#deployments_createorupdate) +- [Delete](#deployments_delete) +- [DisableRemoteDebugging](#deployments_disableremotedebugging) +- [EnableRemoteDebugging](#deployments_enableremotedebugging) +- [GenerateHeapDump](#deployments_generateheapdump) +- [GenerateThreadDump](#deployments_generatethreaddump) +- [Get](#deployments_get) +- [GetLogFileUrl](#deployments_getlogfileurl) +- [GetRemoteDebuggingConfig](#deployments_getremotedebuggingconfig) +- [List](#deployments_list) +- [ListForCluster](#deployments_listforcluster) +- [Restart](#deployments_restart) +- [Start](#deployments_start) +- [StartJfr](#deployments_startjfr) +- [Stop](#deployments_stop) +- [Update](#deployments_update) + +## DevToolPortals + +- [CreateOrUpdate](#devtoolportals_createorupdate) +- [Delete](#devtoolportals_delete) +- [Get](#devtoolportals_get) +- [List](#devtoolportals_list) + +## EurekaServers + +- [Get](#eurekaservers_get) +- [List](#eurekaservers_list) +- [UpdatePatch](#eurekaservers_updatepatch) +- [UpdatePut](#eurekaservers_updateput) + +## GatewayCustomDomains + +- [CreateOrUpdate](#gatewaycustomdomains_createorupdate) +- [Delete](#gatewaycustomdomains_delete) +- [Get](#gatewaycustomdomains_get) +- [List](#gatewaycustomdomains_list) + +## GatewayRouteConfigs + +- [CreateOrUpdate](#gatewayrouteconfigs_createorupdate) +- [Delete](#gatewayrouteconfigs_delete) +- [Get](#gatewayrouteconfigs_get) +- [List](#gatewayrouteconfigs_list) + +## Gateways + +- [CreateOrUpdate](#gateways_createorupdate) +- [Delete](#gateways_delete) +- [Get](#gateways_get) +- [List](#gateways_list) +- [ListEnvSecrets](#gateways_listenvsecrets) +- [Restart](#gateways_restart) +- [UpdateCapacity](#gateways_updatecapacity) +- [ValidateDomain](#gateways_validatedomain) + +## MonitoringSettings + +- [Get](#monitoringsettings_get) +- [UpdatePatch](#monitoringsettings_updatepatch) +- [UpdatePut](#monitoringsettings_updateput) + +## Operations + +- [List](#operations_list) + +## PredefinedAccelerators + +- [Disable](#predefinedaccelerators_disable) +- [Enable](#predefinedaccelerators_enable) +- [Get](#predefinedaccelerators_get) +- [List](#predefinedaccelerators_list) + +## RuntimeVersions + +- [ListRuntimeVersions](#runtimeversions_listruntimeversions) + +## ServiceRegistries + +- [CreateOrUpdate](#serviceregistries_createorupdate) +- [Delete](#serviceregistries_delete) +- [Get](#serviceregistries_get) +- [List](#serviceregistries_list) + +## Services + +- [CheckNameAvailability](#services_checknameavailability) +- [CreateOrUpdate](#services_createorupdate) +- [Delete](#services_delete) +- [DisableApmGlobally](#services_disableapmglobally) +- [DisableTestEndpoint](#services_disabletestendpoint) +- [EnableApmGlobally](#services_enableapmglobally) +- [EnableTestEndpoint](#services_enabletestendpoint) +- [FlushVnetDnsSetting](#services_flushvnetdnssetting) +- [GetByResourceGroup](#services_getbyresourcegroup) +- [List](#services_list) +- [ListByResourceGroup](#services_listbyresourcegroup) +- [ListGloballyEnabledApms](#services_listgloballyenabledapms) +- [ListSupportedApmTypes](#services_listsupportedapmtypes) +- [ListSupportedServerVersions](#services_listsupportedserverversions) +- [ListTestKeys](#services_listtestkeys) +- [RegenerateTestKey](#services_regeneratetestkey) +- [Start](#services_start) +- [Stop](#services_stop) +- [Update](#services_update) + +## Skus + +- [List](#skus_list) + +## Storages + +- [CreateOrUpdate](#storages_createorupdate) +- [Delete](#storages_delete) +- [Get](#storages_get) +- [List](#storages_list) +### ApiPortalCustomDomains_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainProperties; + +/** Samples for ApiPortalCustomDomains CreateOrUpdate. */ +public final class ApiPortalCustomDomainsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ + /** + * Sample code: ApiPortalCustomDomains_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .define("myDomainName") + .withExistingApiPortal("myResourceGroup", "myservice", "default") + .withProperties(new ApiPortalCustomDomainProperties().withThumbprint("*")) + .create(); + } +} +``` + +### ApiPortalCustomDomains_Delete + +```java +/** Samples for ApiPortalCustomDomains Delete. */ +public final class ApiPortalCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ + /** + * Sample code: ApiPortalCustomDomains_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .delete("myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiPortalCustomDomains_Get + +```java +/** Samples for ApiPortalCustomDomains Get. */ +public final class ApiPortalCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_Get.json + */ + /** + * Sample code: ApiPortalCustomDomains_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .getWithResponse( + "myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiPortalCustomDomains_List + +```java +/** Samples for ApiPortalCustomDomains List. */ +public final class ApiPortalCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_List.json + */ + /** + * Sample code: ApiPortalCustomDomains_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiPortals_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.Arrays; + +/** Samples for ApiPortals CreateOrUpdate. */ +public final class ApiPortalsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ + /** + * Sample code: ApiPortals_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortals() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new ApiPortalProperties() + .withPublicProperty(true) + .withGatewayIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default"))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} +``` + +### ApiPortals_Delete + +```java +/** Samples for ApiPortals Delete. */ +public final class ApiPortalsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_Delete.json + */ + /** + * Sample code: ApiPortals_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apiPortals().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiPortals_Get + +```java +/** Samples for ApiPortals Get. */ +public final class ApiPortalsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_Get.json + */ + /** + * Sample code: ApiPortals_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortals() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiPortals_List + +```java +/** Samples for ApiPortals List. */ +public final class ApiPortalsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_List.json + */ + /** + * Sample code: ApiPortals_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apiPortals().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### ApiPortals_ValidateDomain + +```java +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** Samples for ApiPortals ValidateDomain. */ +public final class ApiPortalsValidateDomainSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_ValidateDomain.json + */ + /** + * Sample code: ApiPortals_ValidateDomain. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsValidateDomain( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortals() + .validateDomainWithResponse( + "myResourceGroup", + "myservice", + "default", + new CustomDomainValidatePayload().withName("mydomain.io"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Apms_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApmProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Apms CreateOrUpdate. */ +public final class ApmsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_CreateOrUpdate.json + */ + /** + * Sample code: Apms_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsCreateOrUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apms() + .define("myappinsights") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new ApmProperties() + .withType("ApplicationInsights") + .withProperties(mapOf("any-string", "any-string", "sampling-rate", "12.0")) + .withSecrets( + mapOf( + "connection-string", + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Apms_Delete + +```java +/** Samples for Apms Delete. */ +public final class ApmsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_Delete.json + */ + /** + * Sample code: Apms_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apms().delete("myResourceGroup", "myservice", "myappinsights", com.azure.core.util.Context.NONE); + } +} +``` + +### Apms_Get + +```java +/** Samples for Apms Get. */ +public final class ApmsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_Get.json + */ + /** + * Sample code: Apms_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apms() + .getWithResponse("myResourceGroup", "myservice", "myappinsights", com.azure.core.util.Context.NONE); + } +} +``` + +### Apms_List + +```java +/** Samples for Apms List. */ +public final class ApmsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_List.json + */ + /** + * Sample code: Apms_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apms().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Apms_ListSecretKeys + +```java +/** Samples for Apms ListSecretKeys. */ +public final class ApmsListSecretKeysSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_ListSecretKeys.json + */ + /** + * Sample code: Apms_ListSecretKeys. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsListSecretKeys(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apms() + .listSecretKeysWithResponse( + "myResourceGroup", "myservice", "myappinsights", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationAccelerators_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +/** Samples for ApplicationAccelerators CreateOrUpdate. */ +public final class ApplicationAcceleratorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_CreateOrUpdate.json + */ + /** + * Sample code: ApplicationAccelerators_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationAccelerators() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties(new ApplicationAcceleratorProperties()) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} +``` + +### ApplicationAccelerators_Delete + +```java +/** Samples for ApplicationAccelerators Delete. */ +public final class ApplicationAcceleratorsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_Delete.json + */ + /** + * Sample code: ApplicationAccelerators_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationAccelerators() + .delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationAccelerators_Get + +```java +/** Samples for ApplicationAccelerators Get. */ +public final class ApplicationAcceleratorsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_Get.json + */ + /** + * Sample code: ApplicationAccelerators_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationAccelerators() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationAccelerators_List + +```java +/** Samples for ApplicationAccelerators List. */ +public final class ApplicationAcceleratorsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_List.json + */ + /** + * Sample code: ApplicationAccelerators_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.applicationAccelerators().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationLiveViews_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewProperties; + +/** Samples for ApplicationLiveViews CreateOrUpdate. */ +public final class ApplicationLiveViewsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveViews_CreateOrUpdate.json + */ + /** + * Sample code: ApplicationLiveViews_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationLiveViews() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties(new ApplicationLiveViewProperties()) + .create(); + } +} +``` + +### ApplicationLiveViews_Delete + +```java +/** Samples for ApplicationLiveViews Delete. */ +public final class ApplicationLiveViewsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveView_Delete.json + */ + /** + * Sample code: ApplicationLiveViews_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationLiveViews() + .delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationLiveViews_Get + +```java +/** Samples for ApplicationLiveViews Get. */ +public final class ApplicationLiveViewsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveViews_Get.json + */ + /** + * Sample code: ApplicationLiveViews_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationLiveViews() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ApplicationLiveViews_List + +```java +/** Samples for ApplicationLiveViews List. */ +public final class ApplicationLiveViewsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveViews_List.json + */ + /** + * Sample code: ApplicationLiveViews_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.applicationLiveViews().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Apps_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.AppVNetAddons; +import com.azure.resourcemanager.appplatform.generated.models.AzureFileVolume; +import com.azure.resourcemanager.appplatform.generated.models.CustomPersistentDiskResource; +import com.azure.resourcemanager.appplatform.generated.models.LoadedCertificate; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityType; +import com.azure.resourcemanager.appplatform.generated.models.PersistentDisk; +import com.azure.resourcemanager.appplatform.generated.models.TemporaryDisk; +import com.azure.resourcemanager.appplatform.generated.models.UserAssignedManagedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Apps CreateOrUpdate. */ +public final class AppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_CreateOrUpdate.json + */ + /** + * Sample code: Apps_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsCreateOrUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .define("myapp") + .withExistingSpring("myResourceGroup", "myservice") + .withRegion("eastus") + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs"), + "ServiceRegistry", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry"))) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withEnableSubPath(true) + .withMountOptions( + Arrays.asList("uid=0", "gid=0", "dir_mode=0777", "file_mode=0777")) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false) + .withLoadedCertificates( + Arrays + .asList( + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1") + .withLoadTrustStore(false), + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2") + .withLoadTrustStore(true))) + .withWorkloadProfileName("dedicated1")) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_CreateOrUpdate_VNetInjection.json + */ + /** + * Sample code: Apps_CreateOrUpdate_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsCreateOrUpdateVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .define("myapp") + .withExistingSpring("myResourceGroup", "myservice") + .withRegion("eastus") + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs"), + "ServiceRegistry", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry"))) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withMountOptions( + Arrays.asList("uid=0", "gid=0", "dir_mode=0777", "file_mode=0777")) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false) + .withLoadedCertificates( + Arrays + .asList( + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1") + .withLoadTrustStore(false), + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2") + .withLoadTrustStore(true))) + .withVnetAddons(new AppVNetAddons().withPublicEndpoint(true))) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Apps_Delete + +```java +/** Samples for Apps Delete. */ +public final class AppsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Delete.json + */ + /** + * Sample code: Apps_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().delete("myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} +``` + +### Apps_Get + +```java +/** Samples for Apps Get. */ +public final class AppsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Get_VNetInjection.json + */ + /** + * Sample code: Apps_Get_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsGetVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Get.json + */ + /** + * Sample code: Apps_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE); + } +} +``` + +### Apps_GetResourceUploadUrl + +```java +/** Samples for Apps GetResourceUploadUrl. */ +public final class AppsGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_GetResourceUploadUrl.json + */ + /** + * Sample code: Apps_GetResourceUploadUrl. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsGetResourceUploadUrl( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .getResourceUploadUrlWithResponse( + "myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} +``` + +### Apps_List + +```java +/** Samples for Apps List. */ +public final class AppsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_List.json + */ + /** + * Sample code: Apps_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_List_VNetInjection.json + */ + /** + * Sample code: Apps_List_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsListVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Apps_SetActiveDeployments + +```java +import com.azure.resourcemanager.appplatform.generated.models.ActiveDeploymentCollection; +import java.util.Arrays; + +/** Samples for Apps SetActiveDeployments. */ +public final class AppsSetActiveDeploymentsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_SetActiveDeployments.json + */ + /** + * Sample code: Apps_SetActiveDeployments. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsSetActiveDeployments( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .setActiveDeployments( + "myResourceGroup", + "myservice", + "myapp", + new ActiveDeploymentCollection().withActiveDeploymentNames(Arrays.asList("default")), + com.azure.core.util.Context.NONE); + } +} +``` + +### Apps_Update + +```java +import com.azure.resourcemanager.appplatform.generated.models.AppResource; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.AppVNetAddons; +import com.azure.resourcemanager.appplatform.generated.models.AzureFileVolume; +import com.azure.resourcemanager.appplatform.generated.models.CustomPersistentDiskResource; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityType; +import com.azure.resourcemanager.appplatform.generated.models.PersistentDisk; +import com.azure.resourcemanager.appplatform.generated.models.TemporaryDisk; +import com.azure.resourcemanager.appplatform.generated.models.UserAssignedManagedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Apps Update. */ +public final class AppsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Update_VNetInjection.json + */ + /** + * Sample code: Apps_Update_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsUpdateVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + AppResource resource = + manager + .apps() + .getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withMountOptions(Arrays.asList()) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false) + .withVnetAddons(new AppVNetAddons().withPublicEndpoint(true))) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .apply(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Update.json + */ + /** + * Sample code: Apps_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + AppResource resource = + manager + .apps() + .getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withMountOptions(Arrays.asList()) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false)) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .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; + } +} +``` + +### Apps_ValidateDomain + +```java +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** Samples for Apps ValidateDomain. */ +public final class AppsValidateDomainSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_ValidateDomain.json + */ + /** + * Sample code: Apps_ValidateDomain. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsValidateDomain(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .validateDomainWithResponse( + "myResourceGroup", + "myservice", + "myapp", + new CustomDomainValidatePayload().withName("mydomain.io"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Bindings_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Bindings CreateOrUpdate. */ +public final class BindingsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_CreateOrUpdate.json + */ + /** + * Sample code: Bindings_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .bindings() + .define("mybinding") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new BindingResourceProperties() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1") + .withKey("fakeTokenPlaceholder") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Bindings_Delete + +```java +/** Samples for Bindings Delete. */ +public final class BindingsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_Delete.json + */ + /** + * Sample code: Bindings_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .bindings() + .delete("myResourceGroup", "myservice", "myapp", "mybinding", com.azure.core.util.Context.NONE); + } +} +``` + +### Bindings_Get + +```java +/** Samples for Bindings Get. */ +public final class BindingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_Get.json + */ + /** + * Sample code: Bindings_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .bindings() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mybinding", com.azure.core.util.Context.NONE); + } +} +``` + +### Bindings_List + +```java +/** Samples for Bindings List. */ +public final class BindingsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_List.json + */ + /** + * Sample code: Bindings_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.bindings().list("myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} +``` + +### Bindings_Update + +```java +import com.azure.resourcemanager.appplatform.generated.models.BindingResource; +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Bindings Update. */ +public final class BindingsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_Update.json + */ + /** + * Sample code: Bindings_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + BindingResource resource = + manager + .bindings() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mybinding", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new BindingResourceProperties() + .withKey("fakeTokenPlaceholder") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .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; + } +} +``` + +### BuildService_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceProperties; + +/** Samples for BuildService CreateOrUpdate. */ +public final class BuildServiceCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_CreateOrUpdate.json + */ + /** + * Sample code: BuildService_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new BuildServiceProperties() + .withContainerRegistry( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/containerRegistrys/default")) + .create(); + } +} +``` + +### BuildService_CreateOrUpdateBuild + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.BuildProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.CertificateReference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BuildService CreateOrUpdateBuild. */ +public final class BuildServiceCreateOrUpdateBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ + /** + * Sample code: BuildService_CreateOrUpdateBuild. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceCreateOrUpdateBuild( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .defineBuild("mybuild") + .withExistingBuildService("myResourceGroup", "myservice", "default") + .withProperties( + new BuildProperties() + .withRelativePath( + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777") + .withBuilder( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default") + .withAgentPool( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default") + .withEnv(mapOf("environmentVariable", "test")) + .withApms( + Arrays + .asList( + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"))) + .withCertificates( + Arrays + .asList( + new CertificateReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), + new CertificateReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"))) + .withResourceRequests(new BuildResourceRequests().withCpu("1").withMemory("2Gi"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BuildService_DeleteBuild + +```java +/** Samples for BuildService DeleteBuild. */ +public final class BuildServiceDeleteBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_DeleteBuild.json + */ + /** + * Sample code: BuildService_DeleteBuild. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceDeleteBuild( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .deleteBuild("myResourceGroup", "myservice", "default", "mybuild", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetBuild + +```java +/** Samples for BuildService GetBuild. */ +public final class BuildServiceGetBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuild.json + */ + /** + * Sample code: BuildService_GetBuild. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuild( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildWithResponse( + "myResourceGroup", "myservice", "default", "mybuild", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetBuildResult + +```java +/** Samples for BuildService GetBuildResult. */ +public final class BuildServiceGetBuildResultSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuildResult.json + */ + /** + * Sample code: BuildService_GetBuildResult. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuildResult( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildResultWithResponse( + "myResourceGroup", "myservice", "default", "mybuild", "123", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetBuildResultLog + +```java +/** Samples for BuildService GetBuildResultLog. */ +public final class BuildServiceGetBuildResultLogSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuildResultLog.json + */ + /** + * Sample code: BuildService_GetBuildResultLog. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuildResultLog( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildResultLogWithResponse( + "myResourceGroup", "myservice", "default", "mybuild", "123", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetBuildService + +```java +/** Samples for BuildService GetBuildService. */ +public final class BuildServiceGetBuildServiceSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuildService.json + */ + /** + * Sample code: BuildService_GetBuildService. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuildService( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildServiceWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetResourceUploadUrl + +```java +/** Samples for BuildService GetResourceUploadUrl. */ +public final class BuildServiceGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ + /** + * Sample code: BuildService_GetResourceUploadUrl. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetResourceUploadUrl( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getResourceUploadUrlWithResponse( + "myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetSupportedBuildpack + +```java +/** Samples for BuildService GetSupportedBuildpack. */ +public final class BuildServiceGetSupportedBuildpackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ + /** + * Sample code: BuildService_GetSupportedBuildpack. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetSupportedBuildpack( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getSupportedBuildpackWithResponse( + "myResourceGroup", + "myservice", + "default", + "tanzu-buildpacks-java-azure", + com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_GetSupportedStack + +```java +/** Samples for BuildService GetSupportedStack. */ +public final class BuildServiceGetSupportedStackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetSupportedStack.json + */ + /** + * Sample code: BuildService_GetSupportedStack. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetSupportedStack( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getSupportedStackWithResponse( + "myResourceGroup", + "myservice", + "default", + "io.buildpacks.stacks.bionic-base", + com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_ListBuildResults + +```java +/** Samples for BuildService ListBuildResults. */ +public final class BuildServiceListBuildResultsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListBuildResults.json + */ + /** + * Sample code: BuildService_ListBuildResults. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListBuildResults( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .listBuildResults("myResourceGroup", "myservice", "default", "mybuild", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_ListBuildServices + +```java +/** Samples for BuildService ListBuildServices. */ +public final class BuildServiceListBuildServicesSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListBuildServices.json + */ + /** + * Sample code: BuildService_ListBuildServices. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListBuildServices( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.buildServices().listBuildServices("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_ListBuilds + +```java +/** Samples for BuildService ListBuilds. */ +public final class BuildServiceListBuildsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListBuilds.json + */ + /** + * Sample code: BuildService_ListBuilds. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListBuilds( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.buildServices().listBuilds("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_ListSupportedBuildpacks + +```java +/** Samples for BuildService ListSupportedBuildpacks. */ +public final class BuildServiceListSupportedBuildpacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ + /** + * Sample code: BuildService_ListSupportedBuildpacks. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListSupportedBuildpacks( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .listSupportedBuildpacksWithResponse( + "myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildService_ListSupportedStacks + +```java +/** Samples for BuildService ListSupportedStacks. */ +public final class BuildServiceListSupportedStacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListSupportedStacks.json + */ + /** + * Sample code: BuildService_ListSupportedStacks. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListSupportedStacks( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .listSupportedStacksWithResponse( + "myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceAgentPool_Get + +```java +/** Samples for BuildServiceAgentPool Get. */ +public final class BuildServiceAgentPoolGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceAgentPool_Get.json + */ + /** + * Sample code: BuildServiceAgentPool_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceAgentPoolGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceAgentPools() + .getWithResponse("myResourceGroup", "myservice", "default", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceAgentPool_List + +```java +/** Samples for BuildServiceAgentPool List. */ +public final class BuildServiceAgentPoolListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceAgentPool_List.json + */ + /** + * Sample code: BuildServiceAgentPool_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceAgentPoolList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceAgentPools() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceAgentPool_UpdatePut + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolSizeProperties; + +/** Samples for BuildServiceAgentPool UpdatePut. */ +public final class BuildServiceAgentPoolUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ + /** + * Sample code: BuildServiceAgentPool_UpdatePut. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceAgentPoolUpdatePut( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceAgentPools() + .updatePut( + "myResourceGroup", + "myservice", + "default", + "default", + new BuildServiceAgentPoolResourceInner() + .withProperties( + new BuildServiceAgentPoolProperties() + .withPoolSize(new BuildServiceAgentPoolSizeProperties().withName("S3"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceBuilder_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.BuilderProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpacksGroupProperties; +import com.azure.resourcemanager.appplatform.generated.models.StackProperties; +import java.util.Arrays; + +/** Samples for BuildServiceBuilder CreateOrUpdate. */ +public final class BuildServiceBuilderCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ + /** + * Sample code: BuildServiceBuilder_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .define("mybuilder") + .withExistingBuildService("myResourceGroup", "myservice", "default") + .withProperties( + new BuilderProperties() + .withStack(new StackProperties().withId("io.buildpacks.stacks.bionic").withVersion("base")) + .withBuildpackGroups( + Arrays + .asList( + new BuildpacksGroupProperties() + .withName("mix") + .withBuildpacks( + Arrays + .asList(new BuildpackProperties().withId("tanzu-buildpacks/java-azure")))))) + .create(); + } +} +``` + +### BuildServiceBuilder_Delete + +```java +/** Samples for BuildServiceBuilder Delete. */ +public final class BuildServiceBuilderDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_Delete.json + */ + /** + * Sample code: BuildServiceBuilder_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .delete("myResourceGroup", "myservice", "default", "mybuilder", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceBuilder_Get + +```java +/** Samples for BuildServiceBuilder Get. */ +public final class BuildServiceBuilderGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_Get.json + */ + /** + * Sample code: BuildServiceBuilder_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .getWithResponse("myResourceGroup", "myservice", "default", "mybuilder", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceBuilder_List + +```java +/** Samples for BuildServiceBuilder List. */ +public final class BuildServiceBuilderListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_List.json + */ + /** + * Sample code: BuildServiceBuilder_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildServiceBuilder_ListDeployments + +```java +/** Samples for BuildServiceBuilder ListDeployments. */ +public final class BuildServiceBuilderListDeploymentsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_ListDeployments.json + */ + /** + * Sample code: BuildServiceBuilder_ListDeployments. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderListDeployments( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .listDeploymentsWithResponse( + "myResourceGroup", "myservice", "default", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildpackBinding_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.BindingType; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingLaunchProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BuildpackBinding CreateOrUpdate. */ +public final class BuildpackBindingCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ + /** + * Sample code: BuildpackBinding_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .define("myBuildpackBinding") + .withExistingBuilder("myResourceGroup", "myservice", "default", "default") + .withProperties( + new BuildpackBindingProperties() + .withBindingType(BindingType.APPLICATION_INSIGHTS) + .withLaunchProperties( + new BuildpackBindingLaunchProperties() + .withProperties(mapOf("abc", "def", "any-string", "any-string", "sampling-rate", "12.0")) + .withSecrets( + mapOf( + "connection-string", + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BuildpackBinding_Delete + +```java +/** Samples for BuildpackBinding Delete. */ +public final class BuildpackBindingDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_Delete.json + */ + /** + * Sample code: BuildpackBinding_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .delete( + "myResourceGroup", + "myservice", + "default", + "default", + "myBuildpackBinding", + com.azure.core.util.Context.NONE); + } +} +``` + +### BuildpackBinding_Get + +```java +/** Samples for BuildpackBinding Get. */ +public final class BuildpackBindingGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_Get.json + */ + /** + * Sample code: BuildpackBinding_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .getWithResponse( + "myResourceGroup", + "myservice", + "default", + "default", + "myBuildpackBinding", + com.azure.core.util.Context.NONE); + } +} +``` + +### BuildpackBinding_List + +```java +/** Samples for BuildpackBinding List. */ +public final class BuildpackBindingListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_List.json + */ + /** + * Sample code: BuildpackBinding_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .list("myResourceGroup", "myservice", "default", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### BuildpackBinding_ListForCluster + +```java +/** Samples for BuildpackBinding ListForCluster. */ +public final class BuildpackBindingListForClusterSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_ListForCluster.json + */ + /** + * Sample code: BuildpackBinding_ListForCluster. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingListForCluster( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.buildpackBindings().listForCluster("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Certificates_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.KeyVaultCertificateAutoSync; +import com.azure.resourcemanager.appplatform.generated.models.KeyVaultCertificateProperties; + +/** Samples for Certificates CreateOrUpdate. */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_CreateOrUpdate.json + */ + /** + * Sample code: Certificates_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .certificates() + .define("mycertificate") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new KeyVaultCertificateProperties() + .withVaultUri("https://myvault.vault.azure.net") + .withKeyVaultCertName("fakeTokenPlaceholder") + .withCertVersion("08a219d06d874795a96db47e06fbb01e") + .withAutoSync(KeyVaultCertificateAutoSync.ENABLED)) + .create(); + } +} +``` + +### Certificates_Delete + +```java +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_Delete.json + */ + /** + * Sample code: Certificates_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .certificates() + .delete("myResourceGroup", "myservice", "mycertificate", com.azure.core.util.Context.NONE); + } +} +``` + +### Certificates_Get + +```java +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_Get.json + */ + /** + * Sample code: Certificates_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .certificates() + .getWithResponse("myResourceGroup", "myservice", "mycertificate", com.azure.core.util.Context.NONE); + } +} +``` + +### Certificates_List + +```java +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_List.json + */ + /** + * Sample code: Certificates_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.certificates().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServers_Get + +```java +/** Samples for ConfigServers Get. */ +public final class ConfigServersGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_Get.json + */ + /** + * Sample code: ConfigServers_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.configServers().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_Get_Consumption.json + */ + /** + * Sample code: ConfigServers_Get_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersGetConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.configServers().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServers_UpdatePatch + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import java.util.Arrays; + +/** Samples for ConfigServers UpdatePatch. */ +public final class ConfigServersUpdatePatchSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePatch.json + */ + /** + * Sample code: ConfigServers_UpdatePatch. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePatch( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePatch( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePatch_Consumption.json + */ + /** + * Sample code: ConfigServers_UpdatePatch_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePatchConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePatch( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withEnabledState(ConfigServerEnabledState.ENABLED) + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServers_UpdatePut + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import java.util.Arrays; + +/** Samples for ConfigServers UpdatePut. */ +public final class ConfigServersUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePut_Consumption.json + */ + /** + * Sample code: ConfigServers_UpdatePut_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePutConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePut( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withEnabledState(ConfigServerEnabledState.ENABLED) + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePut.json + */ + /** + * Sample code: ConfigServers_UpdatePut. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePut( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePut( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigServers_Validate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import java.util.Arrays; + +/** Samples for ConfigServers Validate. */ +public final class ConfigServersValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_Validate.json + */ + /** + * Sample code: ConfigServers_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .validate( + "myResourceGroup", + "myservice", + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationServices_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import java.util.Arrays; + +/** Samples for ConfigurationServices CreateOrUpdate. */ +public final class ConfigurationServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ + /** + * Sample code: ConfigurationServices_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new ConfigurationServiceProperties() + .withSettings( + new ConfigurationServiceSettings() + .withGitProperty( + new ConfigurationServiceGitProperty() + .withRepositories( + Arrays + .asList( + new ConfigurationServiceGitRepository() + .withName("fake") + .withPatterns(Arrays.asList("app/dev")) + .withUri("https://github.com/fake-user/fake-repository") + .withLabel("master")))))) + .create(); + } +} +``` + +### ConfigurationServices_Delete + +```java +/** Samples for ConfigurationServices Delete. */ +public final class ConfigurationServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_Delete.json + */ + /** + * Sample code: ConfigurationServices_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationServices_Get + +```java +/** Samples for ConfigurationServices Get. */ +public final class ConfigurationServicesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_Get.json + */ + /** + * Sample code: ConfigurationServices_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationServices_List + +```java +/** Samples for ConfigurationServices List. */ +public final class ConfigurationServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_List.json + */ + /** + * Sample code: ConfigurationServices_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.configurationServices().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationServices_Validate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import java.util.Arrays; + +/** Samples for ConfigurationServices Validate. */ +public final class ConfigurationServicesValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_Validate.json + */ + /** + * Sample code: ConfigurationServices_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .validate( + "myResourceGroup", + "myservice", + "default", + new ConfigurationServiceSettings() + .withGitProperty( + new ConfigurationServiceGitProperty() + .withRepositories( + Arrays + .asList( + new ConfigurationServiceGitRepository() + .withName("fake") + .withPatterns(Arrays.asList("app/dev")) + .withUri("https://github.com/fake-user/fake-repository") + .withLabel("master")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ConfigurationServices_ValidateResource + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import java.util.Arrays; + +/** Samples for ConfigurationServices ValidateResource. */ +public final class ConfigurationServicesValidateResourceSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_ValidateResource.json + */ + /** + * Sample code: ConfigurationServices_ValidateResource. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesValidateResource( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .validateResource( + "myResourceGroup", + "myservice", + "default", + new ConfigurationServiceResourceInner() + .withProperties( + new ConfigurationServiceProperties() + .withSettings( + new ConfigurationServiceSettings() + .withGitProperty( + new ConfigurationServiceGitProperty() + .withRepositories( + Arrays + .asList( + new ConfigurationServiceGitRepository() + .withName("fake") + .withPatterns(Arrays.asList("app/dev")) + .withUri("https://github.com/fake-user/fake-repository") + .withLabel("master")))))), + com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerRegistries_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryBasicCredentials; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; + +/** Samples for ContainerRegistries CreateOrUpdate. */ +public final class ContainerRegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_CreateOrUpdate.json + */ + /** + * Sample code: ContainerRegistries_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .define("my-container-registry") + .withExistingSpring("myResourceGroup", "my-service") + .withProperties( + new ContainerRegistryProperties() + .withCredentials( + new ContainerRegistryBasicCredentials() + .withServer("myServer") + .withUsername("myUsername") + .withPassword("fakeTokenPlaceholder"))) + .create(); + } +} +``` + +### ContainerRegistries_Delete + +```java +/** Samples for ContainerRegistries Delete. */ +public final class ContainerRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_Delete.json + */ + /** + * Sample code: ContainerRegistries_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .delete("myResourceGroup", "service-name", "my-container-registry", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerRegistries_Get + +```java +/** Samples for ContainerRegistries Get. */ +public final class ContainerRegistriesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_Get.json + */ + /** + * Sample code: ContainerRegistries_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .getWithResponse( + "myResourceGroup", "service-name", "my-container-registry", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerRegistries_List + +```java +/** Samples for ContainerRegistries List. */ +public final class ContainerRegistriesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_List.json + */ + /** + * Sample code: ContainerRegistries_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.containerRegistries().list("myResourceGroup", "my-service", com.azure.core.util.Context.NONE); + } +} +``` + +### ContainerRegistries_Validate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryBasicCredentials; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; + +/** Samples for ContainerRegistries Validate. */ +public final class ContainerRegistriesValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_Validate.json + */ + /** + * Sample code: ContainerRegistries_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .validate( + "myResourceGroup", + "my-service", + "my-container-registry", + new ContainerRegistryProperties() + .withCredentials( + new ContainerRegistryBasicCredentials() + .withServer("myServer") + .withUsername("myUsername") + .withPassword("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; + +/** Samples for CustomDomains CreateOrUpdate. */ +public final class CustomDomainsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ + /** + * Sample code: CustomDomains_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customDomains() + .define("mydomain.com") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new CustomDomainProperties() + .withThumbprint("934367bf1c97033f877db0f15cb1b586957d3133") + .withCertName("mycert")) + .create(); + } +} +``` + +### CustomDomains_Delete + +```java +/** Samples for CustomDomains Delete. */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_Delete.json + */ + /** + * Sample code: CustomDomains_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customDomains() + .delete("myResourceGroup", "myservice", "myapp", "mydomain.com", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_Get + +```java +/** Samples for CustomDomains Get. */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_Get.json + */ + /** + * Sample code: CustomDomains_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customDomains() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mydomain.com", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_List + +```java +/** Samples for CustomDomains List. */ +public final class CustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_List.json + */ + /** + * Sample code: CustomDomains_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.customDomains().list("myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomDomains_Update + +```java +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainResource; + +/** Samples for CustomDomains Update. */ +public final class CustomDomainsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_Update.json + */ + /** + * Sample code: CustomDomains_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + CustomDomainResource resource = + manager + .customDomains() + .getWithResponse( + "myResourceGroup", "myservice", "myapp", "mydomain.com", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new CustomDomainProperties() + .withThumbprint("934367bf1c97033f877db0f15cb1b586957d3133") + .withCertName("mycert")) + .apply(); + } +} +``` + +### CustomizedAccelerators_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorSshSetting; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.Arrays; + +/** Samples for CustomizedAccelerators CreateOrUpdate. */ +public final class CustomizedAcceleratorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_CreateOrUpdate.json + */ + /** + * Sample code: CustomizedAccelerators_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .define("acc-name") + .withExistingApplicationAccelerator("myResourceGroup", "myservice", "default") + .withProperties( + new CustomizedAcceleratorProperties() + .withDisplayName("acc-name") + .withDescription("acc-desc") + .withIconUrl("acc-icon") + .withAcceleratorTags(Arrays.asList("tag-a", "tag-b")) + .withGitRepository( + new AcceleratorGitRepository() + .withUrl("git-url") + .withIntervalInSeconds(70) + .withBranch("git-branch") + .withCommit("12345") + .withGitTag("git-tag") + .withAuthSetting( + new AcceleratorSshSetting() + .withHostKey("fakeTokenPlaceholder") + .withHostKeyAlgorithm("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} +``` + +### CustomizedAccelerators_Delete + +```java +/** Samples for CustomizedAccelerators Delete. */ +public final class CustomizedAcceleratorsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_Delete.json + */ + /** + * Sample code: CustomizedAccelerators_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .delete("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomizedAccelerators_Get + +```java +/** Samples for CustomizedAccelerators Get. */ +public final class CustomizedAcceleratorsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_Get.json + */ + /** + * Sample code: CustomizedAccelerators_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .getWithResponse("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomizedAccelerators_List + +```java +/** Samples for CustomizedAccelerators List. */ +public final class CustomizedAcceleratorsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_List.json + */ + /** + * Sample code: CustomizedAccelerators_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### CustomizedAccelerators_Validate + +```java +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorSshSetting; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import java.util.Arrays; + +/** Samples for CustomizedAccelerators Validate. */ +public final class CustomizedAcceleratorsValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_Validate.json + */ + /** + * Sample code: CustomizedAccelerators_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .validateWithResponse( + "myResourceGroup", + "myservice", + "default", + "acc-name", + new CustomizedAcceleratorProperties() + .withDisplayName("acc-name") + .withDescription("acc-desc") + .withIconUrl("acc-icon") + .withAcceleratorTags(Arrays.asList("tag-a", "tag-b")) + .withGitRepository( + new AcceleratorGitRepository() + .withUrl("git-url") + .withIntervalInSeconds(70) + .withBranch("git-branch") + .withCommit("12345") + .withGitTag("git-tag") + .withAuthSetting( + new AcceleratorSshSetting() + .withHostKey("fakeTokenPlaceholder") + .withHostKeyAlgorithm("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.CustomContainer; +import com.azure.resourcemanager.appplatform.generated.models.CustomContainerUserSourceInfo; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentSettings; +import com.azure.resourcemanager.appplatform.generated.models.HttpGetAction; +import com.azure.resourcemanager.appplatform.generated.models.HttpSchemeType; +import com.azure.resourcemanager.appplatform.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.appplatform.generated.models.Probe; +import com.azure.resourcemanager.appplatform.generated.models.ResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.azure.resourcemanager.appplatform.generated.models.SourceUploadedUserSourceInfo; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Deployments CreateOrUpdate. */ +public final class DeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_CreateOrUpdate.json + */ + /** + * Sample code: Deployments_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) throws IOException { + manager + .deployments() + .define("mydeployment") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new DeploymentResourceProperties() + .withSource( + new SourceUploadedUserSourceInfo() + .withVersion("1.0") + .withRelativePath( + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc") + .withArtifactSelector("sub-module-1")) + .withDeploymentSettings( + new DeploymentSettings() + .withResourceRequests(new ResourceRequests().withCpu("1000m").withMemory("3Gi")) + .withEnvironmentVariables(mapOf("env", "test")) + .withApms( + Arrays + .asList( + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"))) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "patterns", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("[\"mypattern\"]", Object.class, SerializerEncoding.JSON)))) + .withLivenessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withReadinessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withTerminationGracePeriodSeconds(30))) + .withSku(new Sku().withName("S0").withTier("Standard").withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ + /** + * Sample code: Deployments_CreateOrUpdate_CustomContainer. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsCreateOrUpdateCustomContainer( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .define("mydeployment") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new DeploymentResourceProperties() + .withSource( + new CustomContainerUserSourceInfo() + .withCustomContainer( + new CustomContainer() + .withServer("myacr.azurecr.io") + .withContainerImage("myContainerImage:v1") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withImageRegistryCredential( + new ImageRegistryCredential() + .withUsername("myUsername") + .withPassword("fakeTokenPlaceholder")) + .withLanguageFramework("springboot"))) + .withDeploymentSettings( + new DeploymentSettings() + .withResourceRequests(new ResourceRequests().withCpu("1000m").withMemory("3Gi")) + .withEnvironmentVariables(mapOf("env", "test")) + .withLivenessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withReadinessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withTerminationGracePeriodSeconds(30))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Deployments_Delete + +```java +/** Samples for Deployments Delete. */ +public final class DeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Delete.json + */ + /** + * Sample code: Deployments_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .delete("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_DisableRemoteDebugging + +```java +/** Samples for Deployments DisableRemoteDebugging. */ +public final class DeploymentsDisableRemoteDebuggingSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_DisableRemoteDebugging.json + */ + /** + * Sample code: Deployments_DisableRemoteDebugging. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsDisableRemoteDebugging( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .disableRemoteDebugging( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_EnableRemoteDebugging + +```java +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebuggingPayload; + +/** Samples for Deployments EnableRemoteDebugging. */ +public final class DeploymentsEnableRemoteDebuggingSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_EnableRemoteDebugging.json + */ + /** + * Sample code: Deployments_EnableRemoteDebugging. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsEnableRemoteDebugging( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .enableRemoteDebugging( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new RemoteDebuggingPayload(), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_GenerateHeapDump + +```java +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; + +/** Samples for Deployments GenerateHeapDump. */ +public final class DeploymentsGenerateHeapDumpSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GenerateHeapDump.json + */ + /** + * Sample code: Deployments_GenerateHeapDump. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGenerateHeapDump( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .generateHeapDump( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new DiagnosticParameters().withAppInstance("myappinstance").withFilePath("/byos/diagnose"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_GenerateThreadDump + +```java +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; + +/** Samples for Deployments GenerateThreadDump. */ +public final class DeploymentsGenerateThreadDumpSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GenerateThreadDump.json + */ + /** + * Sample code: Deployments_GenerateHeapDump. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGenerateHeapDump( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .generateThreadDump( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new DiagnosticParameters().withAppInstance("myappinstance").withFilePath("/byos/diagnose"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_Get + +```java +/** Samples for Deployments Get. */ +public final class DeploymentsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Get.json + */ + /** + * Sample code: Deployments_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Get_CustomContainer.json + */ + /** + * Sample code: Deployments_Get_CustomContainer. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGetCustomContainer( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_GetLogFileUrl + +```java +/** Samples for Deployments GetLogFileUrl. */ +public final class DeploymentsGetLogFileUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GetLogFileUrl.json + */ + /** + * Sample code: Deployments_GetLogFileUrl. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGetLogFileUrl( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getLogFileUrlWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_GetRemoteDebuggingConfig + +```java +/** Samples for Deployments GetRemoteDebuggingConfig. */ +public final class DeploymentsGetRemoteDebuggingConfigSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GetRemoteDebuggingConfig.json + */ + /** + * Sample code: Deployments_GetRemoteDebuggingConfig. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGetRemoteDebuggingConfig( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getRemoteDebuggingConfigWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_List + +```java +/** Samples for Deployments List. */ +public final class DeploymentsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_List.json + */ + /** + * Sample code: Deployments_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .list("myResourceGroup", "myservice", "myapp", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_ListForCluster + +```java +/** Samples for Deployments ListForCluster. */ +public final class DeploymentsListForClusterSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_ListForCluster.json + */ + /** + * Sample code: Deployments_ListForCluster. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsListForCluster( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .listForCluster("myResourceGroup", "myservice", null, null, com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_Restart + +```java +/** Samples for Deployments Restart. */ +public final class DeploymentsRestartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Restart.json + */ + /** + * Sample code: Deployments_Restart. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsRestart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .restart("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_Start + +```java +/** Samples for Deployments Start. */ +public final class DeploymentsStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Start.json + */ + /** + * Sample code: Deployments_Start. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsStart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .start("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_StartJfr + +```java +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; + +/** Samples for Deployments StartJfr. */ +public final class DeploymentsStartJfrSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_StartJFR.json + */ + /** + * Sample code: Deployments_StartJFR. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsStartJFR(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .startJfr( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new DiagnosticParameters() + .withAppInstance("myappinstance") + .withFilePath("/byos/diagnose") + .withDuration("60s"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_Stop + +```java +/** Samples for Deployments Stop. */ +public final class DeploymentsStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Stop.json + */ + /** + * Sample code: Deployments_Stop. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsStop(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .stop("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_Update + +```java +import com.azure.resourcemanager.appplatform.generated.models.CustomContainer; +import com.azure.resourcemanager.appplatform.generated.models.CustomContainerUserSourceInfo; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResource; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.appplatform.generated.models.SourceUploadedUserSourceInfo; +import java.util.Arrays; + +/** Samples for Deployments Update. */ +public final class DeploymentsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Update.json + */ + /** + * Sample code: Deployments_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + DeploymentResource resource = + manager + .deployments() + .getWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new DeploymentResourceProperties() + .withSource( + new SourceUploadedUserSourceInfo() + .withVersion("1.0") + .withRelativePath( + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc") + .withArtifactSelector("sub-module-1"))) + .apply(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Update_CustomContainer.json + */ + /** + * Sample code: Deployments_Update_CustomContainer. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsUpdateCustomContainer( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + DeploymentResource resource = + manager + .deployments() + .getWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new DeploymentResourceProperties() + .withSource( + new CustomContainerUserSourceInfo() + .withCustomContainer( + new CustomContainer() + .withServer("mynewacr.azurecr.io") + .withContainerImage("myNewContainerImage:v1") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withImageRegistryCredential( + new ImageRegistryCredential() + .withUsername("myNewUsername") + .withPassword("fakeTokenPlaceholder"))))) + .apply(); + } +} +``` + +### DevToolPortals_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalFeatureDetail; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalFeatureSettings; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalFeatureState; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalSsoProperties; +import java.util.Arrays; + +/** Samples for DevToolPortals CreateOrUpdate. */ +public final class DevToolPortalsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortals_CreateOrUpdate.json + */ + /** + * Sample code: DevToolPortals_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .devToolPortals() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new DevToolPortalProperties() + .withPublicProperty(true) + .withSsoProperties( + new DevToolPortalSsoProperties() + .withScopes(Arrays.asList("openid")) + .withClientId("00000000-0000-0000-0000-000000000000") + .withClientSecret("fakeTokenPlaceholder") + .withMetadataUrl( + "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration")) + .withFeatures( + new DevToolPortalFeatureSettings() + .withApplicationAccelerator( + new DevToolPortalFeatureDetail().withState(DevToolPortalFeatureState.ENABLED)) + .withApplicationLiveView( + new DevToolPortalFeatureDetail().withState(DevToolPortalFeatureState.ENABLED)))) + .create(); + } +} +``` + +### DevToolPortals_Delete + +```java +/** Samples for DevToolPortals Delete. */ +public final class DevToolPortalsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortal_Delete.json + */ + /** + * Sample code: DevToolPortals_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.devToolPortals().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### DevToolPortals_Get + +```java +/** Samples for DevToolPortals Get. */ +public final class DevToolPortalsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortals_Get.json + */ + /** + * Sample code: DevToolPortals_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .devToolPortals() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### DevToolPortals_List + +```java +/** Samples for DevToolPortals List. */ +public final class DevToolPortalsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortals_List.json + */ + /** + * Sample code: DevToolPortals_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.devToolPortals().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### EurekaServers_Get + +```java +/** Samples for EurekaServers Get. */ +public final class EurekaServersGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_Get_Consumption.json + */ + /** + * Sample code: EurekaServers_Get_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersGetConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.eurekaServers().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### EurekaServers_List + +```java +/** Samples for EurekaServers List. */ +public final class EurekaServersListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_List_Consumption.json + */ + /** + * Sample code: EurekaServers_List_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersListConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.eurekaServers().listWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### EurekaServers_UpdatePatch + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerProperties; + +/** Samples for EurekaServers UpdatePatch. */ +public final class EurekaServersUpdatePatchSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_UpdatePatch_Consumption.json + */ + /** + * Sample code: EurekaServers_UpdatePatch. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersUpdatePatch( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .eurekaServers() + .updatePatch( + "myResourceGroup", + "myservice", + new EurekaServerResourceInner() + .withProperties(new EurekaServerProperties().withEnabledState(EurekaServerEnabledState.ENABLED)), + com.azure.core.util.Context.NONE); + } +} +``` + +### EurekaServers_UpdatePut + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerProperties; + +/** Samples for EurekaServers UpdatePut. */ +public final class EurekaServersUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_UpdatePut_Consumption.json + */ + /** + * Sample code: EurekaServers_UpdatePut_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersUpdatePutConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .eurekaServers() + .updatePut( + "myResourceGroup", + "myservice", + new EurekaServerResourceInner() + .withProperties(new EurekaServerProperties().withEnabledState(EurekaServerEnabledState.ENABLED)), + com.azure.core.util.Context.NONE); + } +} +``` + +### GatewayCustomDomains_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainProperties; + +/** Samples for GatewayCustomDomains CreateOrUpdate. */ +public final class GatewayCustomDomainsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ + /** + * Sample code: GatewayCustomDomains_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .define("myDomainName") + .withExistingGateway("myResourceGroup", "myservice", "default") + .withProperties(new GatewayCustomDomainProperties().withThumbprint("*")) + .create(); + } +} +``` + +### GatewayCustomDomains_Delete + +```java +/** Samples for GatewayCustomDomains Delete. */ +public final class GatewayCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_Delete.json + */ + /** + * Sample code: GatewayCustomDomains_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .delete("myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} +``` + +### GatewayCustomDomains_Get + +```java +/** Samples for GatewayCustomDomains Get. */ +public final class GatewayCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_Get.json + */ + /** + * Sample code: GatewayCustomDomains_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .getWithResponse( + "myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} +``` + +### GatewayCustomDomains_List + +```java +/** Samples for GatewayCustomDomains List. */ +public final class GatewayCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_List.json + */ + /** + * Sample code: GatewayCustomDomains_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### GatewayRouteConfigs_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.GatewayApiRoute; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigOpenApiProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProtocol; +import java.util.Arrays; + +/** Samples for GatewayRouteConfigs CreateOrUpdate. */ +public final class GatewayRouteConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ + /** + * Sample code: GatewayRouteConfigs_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayRouteConfigs() + .define("myRouteConfig") + .withExistingGateway("myResourceGroup", "myservice", "default") + .withProperties( + new GatewayRouteConfigProperties() + .withAppResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp") + .withOpenApi( + new GatewayRouteConfigOpenApiProperties() + .withUri( + "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json")) + .withProtocol(GatewayRouteConfigProtocol.HTTPS) + .withRoutes( + Arrays + .asList( + new GatewayApiRoute() + .withTitle("myApp route config") + .withSsoEnabled(true) + .withPredicates(Arrays.asList("Path=/api5/customer/**")) + .withFilters(Arrays.asList("StripPrefix=2", "RateLimit=1,1s"))))) + .create(); + } +} +``` + +### GatewayRouteConfigs_Delete + +```java +/** Samples for GatewayRouteConfigs Delete. */ +public final class GatewayRouteConfigsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_Delete.json + */ + /** + * Sample code: GatewayRouteConfigs_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayRouteConfigs() + .delete("myResourceGroup", "myservice", "default", "myRouteConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### GatewayRouteConfigs_Get + +```java +/** Samples for GatewayRouteConfigs Get. */ +public final class GatewayRouteConfigsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_Get.json + */ + /** + * Sample code: GatewayRouteConfigs_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayRouteConfigs() + .getWithResponse( + "myResourceGroup", "myservice", "default", "myRouteConfig", com.azure.core.util.Context.NONE); + } +} +``` + +### GatewayRouteConfigs_List + +```java +/** Samples for GatewayRouteConfigs List. */ +public final class GatewayRouteConfigsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_List.json + */ + /** + * Sample code: GatewayRouteConfigs_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gatewayRouteConfigs().list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateways_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.Arrays; + +/** Samples for Gateways CreateOrUpdate. */ +public final class GatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_CreateOrUpdate.json + */ + /** + * Sample code: Gateways_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gateways() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new GatewayProperties() + .withPublicProperty(true) + .withApms( + Arrays + .asList( + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"))) + .withResourceRequests(new GatewayResourceRequests().withCpu("1").withMemory("1G"))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} +``` + +### Gateways_Delete + +```java +/** Samples for Gateways Delete. */ +public final class GatewaysDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_Delete.json + */ + /** + * Sample code: Gateways_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateways_Get + +```java +/** Samples for Gateways Get. */ +public final class GatewaysGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_Get.json + */ + /** + * Sample code: Gateways_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateways_List + +```java +/** Samples for Gateways List. */ +public final class GatewaysListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_List.json + */ + /** + * Sample code: Gateways_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateways_ListEnvSecrets + +```java +/** Samples for Gateways ListEnvSecrets. */ +public final class GatewaysListEnvSecretsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_ListEnvSecrets.json + */ + /** + * Sample code: Gateways_ListEnvSecrets. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysListEnvSecrets( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gateways() + .listEnvSecretsWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateways_Restart + +```java +/** Samples for Gateways Restart. */ +public final class GatewaysRestartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_Restart.json + */ + /** + * Sample code: Gateways_Restart. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysRestart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().restart("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### Gateways_UpdateCapacity + +```java +import com.azure.resourcemanager.appplatform.generated.models.GatewayResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +/** Samples for Gateways UpdateCapacity. */ +public final class GatewaysUpdateCapacitySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateway_Scale.json + */ + /** + * Sample code: Gateway_Scale. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayScale(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + GatewayResource resource = + manager + .gateways() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)).apply(); + } +} +``` + +### Gateways_ValidateDomain + +```java +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** Samples for Gateways ValidateDomain. */ +public final class GatewaysValidateDomainSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_ValidateDomain.json + */ + /** + * Sample code: Gateways_ValidateDomain. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysValidateDomain( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gateways() + .validateDomainWithResponse( + "myResourceGroup", + "myservice", + "default", + new CustomDomainValidatePayload().withName("mydomain.io"), + com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoringSettings_Get + +```java +/** Samples for MonitoringSettings Get. */ +public final class MonitoringSettingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/MonitoringSettings_Get.json + */ + /** + * Sample code: MonitoringSettings_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void monitoringSettingsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.monitoringSettings().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoringSettings_UpdatePatch + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; + +/** Samples for MonitoringSettings UpdatePatch. */ +public final class MonitoringSettingsUpdatePatchSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ + /** + * Sample code: MonitoringSettings_UpdatePatch. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void monitoringSettingsUpdatePatch( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .monitoringSettings() + .updatePatch( + "myResourceGroup", + "myservice", + new MonitoringSettingResourceInner() + .withProperties( + new MonitoringSettingProperties() + .withTraceEnabled(true) + .withAppInsightsInstrumentationKey("fakeTokenPlaceholder") + .withAppInsightsSamplingRate(10.0D)), + com.azure.core.util.Context.NONE); + } +} +``` + +### MonitoringSettings_UpdatePut + +```java +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; + +/** Samples for MonitoringSettings UpdatePut. */ +public final class MonitoringSettingsUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/MonitoringSettings_UpdatePut.json + */ + /** + * Sample code: MonitoringSettings_UpdatePut. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void monitoringSettingsUpdatePut( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .monitoringSettings() + .updatePut( + "myResourceGroup", + "myservice", + new MonitoringSettingResourceInner() + .withProperties( + new MonitoringSettingProperties() + .withTraceEnabled(true) + .withAppInsightsInstrumentationKey("fakeTokenPlaceholder") + .withAppInsightsSamplingRate(10.0D)), + com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void operationsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PredefinedAccelerators_Disable + +```java +/** Samples for PredefinedAccelerators Disable. */ +public final class PredefinedAcceleratorsDisableSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_Disable.json + */ + /** + * Sample code: PredefinedAccelerators_Disable. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsDisable( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .disable("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} +``` + +### PredefinedAccelerators_Enable + +```java +/** Samples for PredefinedAccelerators Enable. */ +public final class PredefinedAcceleratorsEnableSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_Enable.json + */ + /** + * Sample code: PredefinedAccelerators_Enable. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsEnable( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .enable("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} +``` + +### PredefinedAccelerators_Get + +```java +/** Samples for PredefinedAccelerators Get. */ +public final class PredefinedAcceleratorsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_Get.json + */ + /** + * Sample code: PredefinedAccelerators_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .getWithResponse("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} +``` + +### PredefinedAccelerators_List + +```java +/** Samples for PredefinedAccelerators List. */ +public final class PredefinedAcceleratorsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_List.json + */ + /** + * Sample code: PredefinedAccelerators_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### RuntimeVersions_ListRuntimeVersions + +```java +/** Samples for RuntimeVersions ListRuntimeVersions. */ +public final class RuntimeVersionsListRuntimeVersionsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ + /** + * Sample code: RuntimeVersions_ListRuntimeVersions. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void runtimeVersionsListRuntimeVersions( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.runtimeVersions().listRuntimeVersionsWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceRegistries_CreateOrUpdate + +```java +/** Samples for ServiceRegistries CreateOrUpdate. */ +public final class ServiceRegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ + /** + * Sample code: ServiceRegistries_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .serviceRegistries() + .createOrUpdate("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceRegistries_Delete + +```java +/** Samples for ServiceRegistries Delete. */ +public final class ServiceRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_Delete.json + */ + /** + * Sample code: ServiceRegistries_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.serviceRegistries().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceRegistries_Get + +```java +/** Samples for ServiceRegistries Get. */ +public final class ServiceRegistriesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_Get.json + */ + /** + * Sample code: ServiceRegistries_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .serviceRegistries() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### ServiceRegistries_List + +```java +/** Samples for ServiceRegistries List. */ +public final class ServiceRegistriesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_List.json + */ + /** + * Sample code: ServiceRegistries_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.serviceRegistries().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_CheckNameAvailability + +```java +import com.azure.resourcemanager.appplatform.generated.models.NameAvailabilityParameters; + +/** Samples for Services CheckNameAvailability. */ +public final class ServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CheckNameAvailability.json + */ + /** + * Sample code: Services_CheckNameAvailability. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCheckNameAvailability( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .checkNameAvailabilityWithResponse( + "eastus", + new NameAvailabilityParameters().withType("Microsoft.AppPlatform/Spring").withName("myservice"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Services_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.IngressConfig; +import com.azure.resourcemanager.appplatform.generated.models.MarketplaceResource; +import com.azure.resourcemanager.appplatform.generated.models.NetworkProfile; +import com.azure.resourcemanager.appplatform.generated.models.ServiceVNetAddons; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.azure.resourcemanager.appplatform.generated.models.WeekDay; +import com.azure.resourcemanager.appplatform.generated.models.WeeklyMaintenanceScheduleConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate_Consumption.json + */ + /** + * Sample code: Services_CreateOrUpdate_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdateConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withManagedEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment")) + .withSku(new Sku().withName("S0").withTier("StandardGen2")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ + /** + * Sample code: Services_CreateOrUpdate_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdateVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withNetworkProfile( + new NetworkProfile() + .withServiceRuntimeSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime") + .withAppSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps") + .withServiceCidr("10.8.0.0/16,10.244.0.0/16,10.245.0.1/16") + .withServiceRuntimeNetworkResourceGroup("my-service-runtime-network-rg") + .withAppNetworkResourceGroup("my-app-network-rg") + .withIngressConfig(new IngressConfig().withReadTimeoutInSeconds(300))) + .withVnetAddons( + new ServiceVNetAddons().withLogStreamPublicEndpoint(true).withDataPlanePublicEndpoint(true))) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withMaintenanceScheduleConfiguration( + new WeeklyMaintenanceScheduleConfiguration().withHour(10).withDay(WeekDay.SUNDAY))) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate_Enterprise.json + */ + /** + * Sample code: Services_CreateOrUpdate_Enterprise. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdateEnterprise( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withMarketplaceResource( + new MarketplaceResource() + .withPlan("tanzu-asc-ent-mtr") + .withPublisher("vmware-inc") + .withProduct("azure-spring-cloud-vmware-tanzu-2"))) + .withSku(new Sku().withName("E0").withTier("Enterprise")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Services_Delete + +```java +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Delete.json + */ + /** + * Sample code: Services_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().delete("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_DisableApmGlobally + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; + +/** Samples for Services DisableApmGlobally. */ +public final class ServicesDisableApmGloballySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_DisableApmGlobally.json + */ + /** + * Sample code: Services_DisableApmGlobally. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesDisableApmGlobally( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .disableApmGlobally( + "myResourceGroup", + "myservice", + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Services_DisableTestEndpoint + +```java +/** Samples for Services DisableTestEndpoint. */ +public final class ServicesDisableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_DisableTestEndpoint.json + */ + /** + * Sample code: Services_DisableTestEndpoint. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesDisableTestEndpoint( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .disableTestEndpointWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_EnableApmGlobally + +```java +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; + +/** Samples for Services EnableApmGlobally. */ +public final class ServicesEnableApmGloballySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_EnableApmGlobally.json + */ + /** + * Sample code: Services_EnableApmGlobally. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesEnableApmGlobally( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .enableApmGlobally( + "myResourceGroup", + "myservice", + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"), + com.azure.core.util.Context.NONE); + } +} +``` + +### Services_EnableTestEndpoint + +```java +/** Samples for Services EnableTestEndpoint. */ +public final class ServicesEnableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_EnableTestEndpoint.json + */ + /** + * Sample code: Services_EnableTestEndpoint. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesEnableTestEndpoint( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .enableTestEndpointWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_FlushVnetDnsSetting + +```java +/** Samples for Services FlushVnetDnsSetting. */ +public final class ServicesFlushVnetDnsSettingSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_FlushVnetDnsSetting.json + */ + /** + * Sample code: Services_FlushVnetDnsSetting. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesFlushVnetDnsSetting( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().flushVnetDnsSetting("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_GetByResourceGroup + +```java +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Get.json + */ + /** + * Sample code: Services_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .getByResourceGroupWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Get_Consumption.json + */ + /** + * Sample code: Services_Get_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesGetConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .getByResourceGroupWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_List + +```java +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListBySubscription.json + */ + /** + * Sample code: Services_ListBySubscription. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListBySubscription( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Services_ListByResourceGroup + +```java +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_List.json + */ + /** + * Sample code: Services_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_ListGloballyEnabledApms + +```java +/** Samples for Services ListGloballyEnabledApms. */ +public final class ServicesListGloballyEnabledApmsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListGloballyEnabledApms.json + */ + /** + * Sample code: Services_ListGloballyEnabledApms. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListGloballyEnabledApms( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .listGloballyEnabledApmsWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_ListSupportedApmTypes + +```java +/** Samples for Services ListSupportedApmTypes. */ +public final class ServicesListSupportedApmTypesSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListSupportedApmTypes.json + */ + /** + * Sample code: Services_ListSupportedApmTypes. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListSupportedApmTypes( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().listSupportedApmTypes("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_ListSupportedServerVersions + +```java +/** Samples for Services ListSupportedServerVersions. */ +public final class ServicesListSupportedServerVersionsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListSupportedServerVersions.json + */ + /** + * Sample code: Services_ListSupportedServerVersions. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListSupportedServerVersions( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .listSupportedServerVersions("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_ListTestKeys + +```java +/** Samples for Services ListTestKeys. */ +public final class ServicesListTestKeysSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListTestKeys.json + */ + /** + * Sample code: Services_ListTestKeys. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListTestKeys( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().listTestKeysWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_RegenerateTestKey + +```java +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.generated.models.TestKeyType; + +/** Samples for Services RegenerateTestKey. */ +public final class ServicesRegenerateTestKeySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_RegenerateTestKey.json + */ + /** + * Sample code: Services_RegenerateTestKey. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesRegenerateTestKey( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .regenerateTestKeyWithResponse( + "myResourceGroup", + "myservice", + new RegenerateTestKeyRequestPayload().withKeyType(TestKeyType.PRIMARY), + com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Start + +```java +/** Samples for Services Start. */ +public final class ServicesStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Start.json + */ + /** + * Sample code: Services_Start. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesStart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().start("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Stop + +```java +/** Samples for Services Stop. */ +public final class ServicesStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Stop.json + */ + /** + * Sample code: Services_Stop. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesStop(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().stop("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + +### Services_Update + +```java +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ServiceResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services Update. */ +public final class ServicesUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Update.json + */ + /** + * Sample code: Services_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + ServiceResource resource = + manager + .services() + .getByResourceGroupWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterResourceProperties()) + .withSku(new Sku().withName("S0").withTier("Standard")) + .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; + } +} +``` + +### Skus_List + +```java +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Skus_List.json + */ + /** + * Sample code: Skus_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void skusList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.skus().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Storages_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.StorageAccount; + +/** Samples for Storages CreateOrUpdate. */ +public final class StoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_CreateOrUpdate.json + */ + /** + * Sample code: Storages_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .storages() + .define("mystorage") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new StorageAccount().withAccountName("storage-account-name").withAccountKey("fakeTokenPlaceholder")) + .create(); + } +} +``` + +### Storages_Delete + +```java +/** Samples for Storages Delete. */ +public final class StoragesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_Delete.json + */ + /** + * Sample code: Storages_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.storages().delete("myResourceGroup", "myservice", "mystorage", com.azure.core.util.Context.NONE); + } +} +``` + +### Storages_Get + +```java +/** Samples for Storages Get. */ +public final class StoragesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_Get.json + */ + /** + * Sample code: Storages_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .storages() + .getWithResponse("myResourceGroup", "myservice", "mystorage", com.azure.core.util.Context.NONE); + } +} +``` + +### Storages_List + +```java +/** Samples for Storages List. */ +public final class StoragesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_List.json + */ + /** + * Sample code: Storages_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.storages().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/pom.xml b/sdk/appplatform/azure-resourcemanager-appplatform-generated/pom.xml new file mode 100644 index 0000000000000..b39f37519f2d6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/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-appplatform-generated + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for AppPlatform Management + This package contains Microsoft Azure SDK for AppPlatform Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure Spring Apps. Package tag package-preview-2023-11. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.43.0 + + + com.azure + azure-core-management + 1.11.5 + + + diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/AppPlatformManager.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/AppPlatformManager.java new file mode 100644 index 0000000000000..33891be0d654b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/AppPlatformManager.java @@ -0,0 +1,769 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated; + +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.appplatform.generated.fluent.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.generated.implementation.ApiPortalCustomDomainsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ApiPortalsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ApmsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.AppPlatformManagementClientBuilder; +import com.azure.resourcemanager.appplatform.generated.implementation.ApplicationAcceleratorsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ApplicationLiveViewsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.AppsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.BindingsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.BuildServiceAgentPoolsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.BuildServiceBuildersImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.BuildServicesImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.BuildpackBindingsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.CertificatesImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ConfigServersImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ConfigurationServicesImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ContainerRegistriesImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.CustomDomainsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.CustomizedAcceleratorsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.DeploymentsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.DevToolPortalsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.EurekaServersImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.GatewayCustomDomainsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.GatewayRouteConfigsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.GatewaysImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.MonitoringSettingsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.OperationsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.PredefinedAcceleratorsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.RuntimeVersionsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ServiceRegistriesImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.ServicesImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.SkusImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.StoragesImpl; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomains; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortals; +import com.azure.resourcemanager.appplatform.generated.models.Apms; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAccelerators; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViews; +import com.azure.resourcemanager.appplatform.generated.models.Apps; +import com.azure.resourcemanager.appplatform.generated.models.Bindings; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPools; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceBuilders; +import com.azure.resourcemanager.appplatform.generated.models.BuildServices; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindings; +import com.azure.resourcemanager.appplatform.generated.models.Certificates; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServers; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServices; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistries; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomains; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAccelerators; +import com.azure.resourcemanager.appplatform.generated.models.Deployments; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortals; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServers; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomains; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigs; +import com.azure.resourcemanager.appplatform.generated.models.Gateways; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettings; +import com.azure.resourcemanager.appplatform.generated.models.Operations; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAccelerators; +import com.azure.resourcemanager.appplatform.generated.models.RuntimeVersions; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistries; +import com.azure.resourcemanager.appplatform.generated.models.Services; +import com.azure.resourcemanager.appplatform.generated.models.Skus; +import com.azure.resourcemanager.appplatform.generated.models.Storages; +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 AppPlatformManager. REST API for Azure Spring Apps. */ +public final class AppPlatformManager { + private Services services; + + private Apms apms; + + private EurekaServers eurekaServers; + + private ConfigServers configServers; + + private ConfigurationServices configurationServices; + + private ServiceRegistries serviceRegistries; + + private ApplicationLiveViews applicationLiveViews; + + private DevToolPortals devToolPortals; + + private ContainerRegistries containerRegistries; + + private BuildServices buildServices; + + private BuildpackBindings buildpackBindings; + + private BuildServiceBuilders buildServiceBuilders; + + private BuildServiceAgentPools buildServiceAgentPools; + + private MonitoringSettings monitoringSettings; + + private Apps apps; + + private Bindings bindings; + + private Storages storages; + + private Certificates certificates; + + private CustomDomains customDomains; + + private Deployments deployments; + + private Operations operations; + + private RuntimeVersions runtimeVersions; + + private Skus skus; + + private Gateways gateways; + + private GatewayRouteConfigs gatewayRouteConfigs; + + private GatewayCustomDomains gatewayCustomDomains; + + private ApiPortals apiPortals; + + private ApiPortalCustomDomains apiPortalCustomDomains; + + private ApplicationAccelerators applicationAccelerators; + + private CustomizedAccelerators customizedAccelerators; + + private PredefinedAccelerators predefinedAccelerators; + + private final AppPlatformManagementClient clientObject; + + private AppPlatformManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new AppPlatformManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of AppPlatform service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the AppPlatform service API instance. + */ + public static AppPlatformManager 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 AppPlatform service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the AppPlatform service API instance. + */ + public static AppPlatformManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new AppPlatformManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create AppPlatformManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new AppPlatformManager.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 AppPlatform service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the AppPlatform service API instance. + */ + public AppPlatformManager 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.appplatform.generated") + .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 AppPlatformManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Services. It manages ServiceResource. + * + * @return Resource collection API of Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(clientObject.getServices(), this); + } + return services; + } + + /** + * Gets the resource collection API of Apms. It manages ApmResource. + * + * @return Resource collection API of Apms. + */ + public Apms apms() { + if (this.apms == null) { + this.apms = new ApmsImpl(clientObject.getApms(), this); + } + return apms; + } + + /** + * Gets the resource collection API of EurekaServers. + * + * @return Resource collection API of EurekaServers. + */ + public EurekaServers eurekaServers() { + if (this.eurekaServers == null) { + this.eurekaServers = new EurekaServersImpl(clientObject.getEurekaServers(), this); + } + return eurekaServers; + } + + /** + * Gets the resource collection API of ConfigServers. + * + * @return Resource collection API of ConfigServers. + */ + public ConfigServers configServers() { + if (this.configServers == null) { + this.configServers = new ConfigServersImpl(clientObject.getConfigServers(), this); + } + return configServers; + } + + /** + * Gets the resource collection API of ConfigurationServices. It manages ConfigurationServiceResource. + * + * @return Resource collection API of ConfigurationServices. + */ + public ConfigurationServices configurationServices() { + if (this.configurationServices == null) { + this.configurationServices = new ConfigurationServicesImpl(clientObject.getConfigurationServices(), this); + } + return configurationServices; + } + + /** + * Gets the resource collection API of ServiceRegistries. + * + * @return Resource collection API of ServiceRegistries. + */ + public ServiceRegistries serviceRegistries() { + if (this.serviceRegistries == null) { + this.serviceRegistries = new ServiceRegistriesImpl(clientObject.getServiceRegistries(), this); + } + return serviceRegistries; + } + + /** + * Gets the resource collection API of ApplicationLiveViews. It manages ApplicationLiveViewResource. + * + * @return Resource collection API of ApplicationLiveViews. + */ + public ApplicationLiveViews applicationLiveViews() { + if (this.applicationLiveViews == null) { + this.applicationLiveViews = new ApplicationLiveViewsImpl(clientObject.getApplicationLiveViews(), this); + } + return applicationLiveViews; + } + + /** + * Gets the resource collection API of DevToolPortals. It manages DevToolPortalResource. + * + * @return Resource collection API of DevToolPortals. + */ + public DevToolPortals devToolPortals() { + if (this.devToolPortals == null) { + this.devToolPortals = new DevToolPortalsImpl(clientObject.getDevToolPortals(), this); + } + return devToolPortals; + } + + /** + * Gets the resource collection API of ContainerRegistries. It manages ContainerRegistryResource. + * + * @return Resource collection API of ContainerRegistries. + */ + public ContainerRegistries containerRegistries() { + if (this.containerRegistries == null) { + this.containerRegistries = new ContainerRegistriesImpl(clientObject.getContainerRegistries(), this); + } + return containerRegistries; + } + + /** + * Gets the resource collection API of BuildServices. It manages BuildService, Build. + * + * @return Resource collection API of BuildServices. + */ + public BuildServices buildServices() { + if (this.buildServices == null) { + this.buildServices = new BuildServicesImpl(clientObject.getBuildServices(), this); + } + return buildServices; + } + + /** + * Gets the resource collection API of BuildpackBindings. It manages BuildpackBindingResource. + * + * @return Resource collection API of BuildpackBindings. + */ + public BuildpackBindings buildpackBindings() { + if (this.buildpackBindings == null) { + this.buildpackBindings = new BuildpackBindingsImpl(clientObject.getBuildpackBindings(), this); + } + return buildpackBindings; + } + + /** + * Gets the resource collection API of BuildServiceBuilders. It manages BuilderResource. + * + * @return Resource collection API of BuildServiceBuilders. + */ + public BuildServiceBuilders buildServiceBuilders() { + if (this.buildServiceBuilders == null) { + this.buildServiceBuilders = new BuildServiceBuildersImpl(clientObject.getBuildServiceBuilders(), this); + } + return buildServiceBuilders; + } + + /** + * Gets the resource collection API of BuildServiceAgentPools. + * + * @return Resource collection API of BuildServiceAgentPools. + */ + public BuildServiceAgentPools buildServiceAgentPools() { + if (this.buildServiceAgentPools == null) { + this.buildServiceAgentPools = + new BuildServiceAgentPoolsImpl(clientObject.getBuildServiceAgentPools(), this); + } + return buildServiceAgentPools; + } + + /** + * Gets the resource collection API of MonitoringSettings. + * + * @return Resource collection API of MonitoringSettings. + */ + public MonitoringSettings monitoringSettings() { + if (this.monitoringSettings == null) { + this.monitoringSettings = new MonitoringSettingsImpl(clientObject.getMonitoringSettings(), this); + } + return monitoringSettings; + } + + /** + * Gets the resource collection API of Apps. It manages AppResource. + * + * @return Resource collection API of Apps. + */ + public Apps apps() { + if (this.apps == null) { + this.apps = new AppsImpl(clientObject.getApps(), this); + } + return apps; + } + + /** + * Gets the resource collection API of Bindings. It manages BindingResource. + * + * @return Resource collection API of Bindings. + */ + public Bindings bindings() { + if (this.bindings == null) { + this.bindings = new BindingsImpl(clientObject.getBindings(), this); + } + return bindings; + } + + /** + * Gets the resource collection API of Storages. It manages StorageResource. + * + * @return Resource collection API of Storages. + */ + public Storages storages() { + if (this.storages == null) { + this.storages = new StoragesImpl(clientObject.getStorages(), this); + } + return storages; + } + + /** + * Gets the resource collection API of Certificates. It manages CertificateResource. + * + * @return Resource collection API of Certificates. + */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); + } + return certificates; + } + + /** + * Gets the resource collection API of CustomDomains. It manages CustomDomainResource. + * + * @return Resource collection API of CustomDomains. + */ + public CustomDomains customDomains() { + if (this.customDomains == null) { + this.customDomains = new CustomDomainsImpl(clientObject.getCustomDomains(), this); + } + return customDomains; + } + + /** + * Gets the resource collection API of Deployments. It manages DeploymentResource. + * + * @return Resource collection API of Deployments. + */ + public Deployments deployments() { + if (this.deployments == null) { + this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this); + } + return deployments; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets the resource collection API of RuntimeVersions. + * + * @return Resource collection API of RuntimeVersions. + */ + public RuntimeVersions runtimeVersions() { + if (this.runtimeVersions == null) { + this.runtimeVersions = new RuntimeVersionsImpl(clientObject.getRuntimeVersions(), this); + } + return runtimeVersions; + } + + /** + * Gets the resource collection API of Skus. + * + * @return Resource collection API of Skus. + */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** + * Gets the resource collection API of Gateways. It manages GatewayResource. + * + * @return Resource collection API of Gateways. + */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + + /** + * Gets the resource collection API of GatewayRouteConfigs. It manages GatewayRouteConfigResource. + * + * @return Resource collection API of GatewayRouteConfigs. + */ + public GatewayRouteConfigs gatewayRouteConfigs() { + if (this.gatewayRouteConfigs == null) { + this.gatewayRouteConfigs = new GatewayRouteConfigsImpl(clientObject.getGatewayRouteConfigs(), this); + } + return gatewayRouteConfigs; + } + + /** + * Gets the resource collection API of GatewayCustomDomains. It manages GatewayCustomDomainResource. + * + * @return Resource collection API of GatewayCustomDomains. + */ + public GatewayCustomDomains gatewayCustomDomains() { + if (this.gatewayCustomDomains == null) { + this.gatewayCustomDomains = new GatewayCustomDomainsImpl(clientObject.getGatewayCustomDomains(), this); + } + return gatewayCustomDomains; + } + + /** + * Gets the resource collection API of ApiPortals. It manages ApiPortalResource. + * + * @return Resource collection API of ApiPortals. + */ + public ApiPortals apiPortals() { + if (this.apiPortals == null) { + this.apiPortals = new ApiPortalsImpl(clientObject.getApiPortals(), this); + } + return apiPortals; + } + + /** + * Gets the resource collection API of ApiPortalCustomDomains. It manages ApiPortalCustomDomainResource. + * + * @return Resource collection API of ApiPortalCustomDomains. + */ + public ApiPortalCustomDomains apiPortalCustomDomains() { + if (this.apiPortalCustomDomains == null) { + this.apiPortalCustomDomains = + new ApiPortalCustomDomainsImpl(clientObject.getApiPortalCustomDomains(), this); + } + return apiPortalCustomDomains; + } + + /** + * Gets the resource collection API of ApplicationAccelerators. It manages ApplicationAcceleratorResource. + * + * @return Resource collection API of ApplicationAccelerators. + */ + public ApplicationAccelerators applicationAccelerators() { + if (this.applicationAccelerators == null) { + this.applicationAccelerators = + new ApplicationAcceleratorsImpl(clientObject.getApplicationAccelerators(), this); + } + return applicationAccelerators; + } + + /** + * Gets the resource collection API of CustomizedAccelerators. It manages CustomizedAcceleratorResource. + * + * @return Resource collection API of CustomizedAccelerators. + */ + public CustomizedAccelerators customizedAccelerators() { + if (this.customizedAccelerators == null) { + this.customizedAccelerators = + new CustomizedAcceleratorsImpl(clientObject.getCustomizedAccelerators(), this); + } + return customizedAccelerators; + } + + /** + * Gets the resource collection API of PredefinedAccelerators. + * + * @return Resource collection API of PredefinedAccelerators. + */ + public PredefinedAccelerators predefinedAccelerators() { + if (this.predefinedAccelerators == null) { + this.predefinedAccelerators = + new PredefinedAcceleratorsImpl(clientObject.getPredefinedAccelerators(), this); + } + return predefinedAccelerators; + } + + /** + * Gets wrapped service client AppPlatformManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client AppPlatformManagementClient. + */ + public AppPlatformManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalCustomDomainsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalCustomDomainsClient.java new file mode 100644 index 0000000000000..dd32c688a77b9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalCustomDomainsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; + +/** An instance of this class provides access to all the operations defined in ApiPortalCustomDomainsClient. */ +public interface ApiPortalCustomDomainsClient { + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @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 API portal custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, Context context); + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiPortalCustomDomainResourceInner get( + String resourceGroupName, String serviceName, String apiPortalName, String domainName); + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update 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 custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiPortalCustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource); + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiPortalCustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context); + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update 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 custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiPortalCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource); + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiPortalCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context); + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String apiPortalName, String domainName); + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @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 serviceName, String apiPortalName, String domainName, Context context); + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiPortalName, String domainName); + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @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 serviceName, String apiPortalName, String domainName, Context context); + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName); + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalsClient.java new file mode 100644 index 0000000000000..c22e434cc16db --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalsClient.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ApiPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** An instance of this class provides access to all the operations defined in ApiPortalsClient. */ +public interface ApiPortalsClient { + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 API portal and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, Context context); + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiPortalResourceInner get(String resourceGroupName, String serviceName, String apiPortalName); + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update 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 aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource); + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApiPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context); + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update 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 aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiPortalResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource); + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApiPortalResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context); + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String apiPortalName); + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 serviceName, String apiPortalName, Context context); + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiPortalName); + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 serviceName, String apiPortalName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload, + Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainValidateResultInner validateDomain( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApmsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApmsClient.java new file mode 100644 index 0000000000000..86a921b04e6ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApmsClient.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ApmResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmSecretKeysInner; + +/** An instance of this class provides access to all the operations defined in ApmsClient. */ +public interface ApmsClient { + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 APM by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context); + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApmResourceInner get(String resourceGroupName, String serviceName, String apmName); + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update 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 aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApmResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource); + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApmResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, Context context); + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update 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 aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApmResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource); + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApmResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, Context context); + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String apmName); + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 serviceName, String apmName, Context context); + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apmName); + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 serviceName, String apmName, Context context); + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 keys of APM sensitive properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretKeysWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context); + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApmSecretKeysInner listSecretKeys(String resourceGroupName, String serviceName, String apmName); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppPlatformManagementClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppPlatformManagementClient.java new file mode 100644 index 0000000000000..bef0bbf85e8ba --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppPlatformManagementClient.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for AppPlatformManagementClient class. */ +public interface AppPlatformManagementClient { + /** + * Gets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @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 ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + ServicesClient getServices(); + + /** + * Gets the ApmsClient object to access its operations. + * + * @return the ApmsClient object. + */ + ApmsClient getApms(); + + /** + * Gets the EurekaServersClient object to access its operations. + * + * @return the EurekaServersClient object. + */ + EurekaServersClient getEurekaServers(); + + /** + * Gets the ConfigServersClient object to access its operations. + * + * @return the ConfigServersClient object. + */ + ConfigServersClient getConfigServers(); + + /** + * Gets the ConfigurationServicesClient object to access its operations. + * + * @return the ConfigurationServicesClient object. + */ + ConfigurationServicesClient getConfigurationServices(); + + /** + * Gets the ServiceRegistriesClient object to access its operations. + * + * @return the ServiceRegistriesClient object. + */ + ServiceRegistriesClient getServiceRegistries(); + + /** + * Gets the ApplicationLiveViewsClient object to access its operations. + * + * @return the ApplicationLiveViewsClient object. + */ + ApplicationLiveViewsClient getApplicationLiveViews(); + + /** + * Gets the DevToolPortalsClient object to access its operations. + * + * @return the DevToolPortalsClient object. + */ + DevToolPortalsClient getDevToolPortals(); + + /** + * Gets the ContainerRegistriesClient object to access its operations. + * + * @return the ContainerRegistriesClient object. + */ + ContainerRegistriesClient getContainerRegistries(); + + /** + * Gets the BuildServicesClient object to access its operations. + * + * @return the BuildServicesClient object. + */ + BuildServicesClient getBuildServices(); + + /** + * Gets the BuildpackBindingsClient object to access its operations. + * + * @return the BuildpackBindingsClient object. + */ + BuildpackBindingsClient getBuildpackBindings(); + + /** + * Gets the BuildServiceBuildersClient object to access its operations. + * + * @return the BuildServiceBuildersClient object. + */ + BuildServiceBuildersClient getBuildServiceBuilders(); + + /** + * Gets the BuildServiceAgentPoolsClient object to access its operations. + * + * @return the BuildServiceAgentPoolsClient object. + */ + BuildServiceAgentPoolsClient getBuildServiceAgentPools(); + + /** + * Gets the MonitoringSettingsClient object to access its operations. + * + * @return the MonitoringSettingsClient object. + */ + MonitoringSettingsClient getMonitoringSettings(); + + /** + * Gets the AppsClient object to access its operations. + * + * @return the AppsClient object. + */ + AppsClient getApps(); + + /** + * Gets the BindingsClient object to access its operations. + * + * @return the BindingsClient object. + */ + BindingsClient getBindings(); + + /** + * Gets the StoragesClient object to access its operations. + * + * @return the StoragesClient object. + */ + StoragesClient getStorages(); + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + CertificatesClient getCertificates(); + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + CustomDomainsClient getCustomDomains(); + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + DeploymentsClient getDeployments(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the RuntimeVersionsClient object to access its operations. + * + * @return the RuntimeVersionsClient object. + */ + RuntimeVersionsClient getRuntimeVersions(); + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + SkusClient getSkus(); + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + GatewaysClient getGateways(); + + /** + * Gets the GatewayRouteConfigsClient object to access its operations. + * + * @return the GatewayRouteConfigsClient object. + */ + GatewayRouteConfigsClient getGatewayRouteConfigs(); + + /** + * Gets the GatewayCustomDomainsClient object to access its operations. + * + * @return the GatewayCustomDomainsClient object. + */ + GatewayCustomDomainsClient getGatewayCustomDomains(); + + /** + * Gets the ApiPortalsClient object to access its operations. + * + * @return the ApiPortalsClient object. + */ + ApiPortalsClient getApiPortals(); + + /** + * Gets the ApiPortalCustomDomainsClient object to access its operations. + * + * @return the ApiPortalCustomDomainsClient object. + */ + ApiPortalCustomDomainsClient getApiPortalCustomDomains(); + + /** + * Gets the ApplicationAcceleratorsClient object to access its operations. + * + * @return the ApplicationAcceleratorsClient object. + */ + ApplicationAcceleratorsClient getApplicationAccelerators(); + + /** + * Gets the CustomizedAcceleratorsClient object to access its operations. + * + * @return the CustomizedAcceleratorsClient object. + */ + CustomizedAcceleratorsClient getCustomizedAccelerators(); + + /** + * Gets the PredefinedAcceleratorsClient object to access its operations. + * + * @return the PredefinedAcceleratorsClient object. + */ + PredefinedAcceleratorsClient getPredefinedAccelerators(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApplicationAcceleratorsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApplicationAcceleratorsClient.java new file mode 100644 index 0000000000000..50c3840f34dfd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApplicationAcceleratorsClient.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner; + +/** An instance of this class provides access to all the operations defined in ApplicationAcceleratorsClient. */ +public interface ApplicationAcceleratorsClient { + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, Context context); + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 application accelerator along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationAcceleratorResourceInner get( + String resourceGroupName, String serviceName, String applicationAcceleratorName); + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update 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 application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationAcceleratorResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource); + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationAcceleratorResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + Context context); + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update 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 application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource); + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + Context context); + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String applicationAcceleratorName); + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 serviceName, String applicationAcceleratorName, Context context); + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String applicationAcceleratorName); + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 serviceName, String applicationAcceleratorName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApplicationLiveViewsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApplicationLiveViewsClient.java new file mode 100644 index 0000000000000..584015dc192ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApplicationLiveViewsClient.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner; + +/** An instance of this class provides access to all the operations defined in ApplicationLiveViewsClient. */ +public interface ApplicationLiveViewsClient { + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @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 Application Live and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String applicationLiveViewName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationLiveViewResourceInner get(String resourceGroupName, String serviceName, String applicationLiveViewName); + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update 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 application Live View resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationLiveViewResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource); + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of application Live View resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ApplicationLiveViewResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + Context context); + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update 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 application Live View resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationLiveViewResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource); + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ApplicationLiveViewResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + Context context); + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String applicationLiveViewName); + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @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 serviceName, String applicationLiveViewName, Context context); + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String applicationLiveViewName); + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @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 serviceName, String applicationLiveViewName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppsClient.java new file mode 100644 index 0000000000000..1f3e5fc423a6b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppsClient.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.AppResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.models.ActiveDeploymentCollection; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** An instance of this class provides access to all the operations defined in AppsClient. */ +public interface AppsClient { + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context); + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner get(String resourceGroupName, String serviceName, String appName); + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource); + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context); + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource); + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context); + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName, String appName); + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName); + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource); + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context); + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner update(String resourceGroupName, String serviceName, String appName, AppResourceInner appResource); + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceUploadDefinitionInner getResourceUploadUrl(String resourceGroupName, String serviceName, String appName); + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppResourceInner> beginSetActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection); + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AppResourceInner> beginSetActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context); + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection); + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AppResourceInner setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context); + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String appName, + CustomDomainValidatePayload validatePayload, + Context context); + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainValidateResultInner validateDomain( + String resourceGroupName, String serviceName, String appName, CustomDomainValidatePayload validatePayload); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BindingsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BindingsClient.java new file mode 100644 index 0000000000000..340dcab02b23e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BindingsClient.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.BindingResourceInner; + +/** An instance of this class provides access to all the operations defined in BindingsClient. */ +public interface BindingsClient { + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context); + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BindingResourceInner get(String resourceGroupName, String serviceName, String appName, String bindingName); + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource); + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context); + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource); + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context); + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String bindingName); + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context); + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, String bindingName); + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, String bindingName, Context context); + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BindingResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource); + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BindingResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context); + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource); + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String appName); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceAgentPoolsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceAgentPoolsClient.java new file mode 100644 index 0000000000000..cf566af350443 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceAgentPoolsClient.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; + +/** An instance of this class provides access to all the operations defined in BuildServiceAgentPoolsClient. */ +public interface BuildServiceAgentPoolsClient { + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName, Context context); + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildServiceAgentPoolResourceInner get( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName); + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildServiceAgentPoolResourceInner> beginUpdatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource); + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildServiceAgentPoolResourceInner> beginUpdatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context); + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update 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 build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildServiceAgentPoolResourceInner updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource); + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildServiceAgentPoolResourceInner updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceBuildersClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceBuildersClient.java new file mode 100644 index 0000000000000..2ae41d5947841 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceBuildersClient.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentListInner; + +/** An instance of this class provides access to all the operations defined in BuildServiceBuildersClient. */ +public interface BuildServiceBuildersClient { + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner get(String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update 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 kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource); + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context); + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update 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 kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource); + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuilderResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context); + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listDeploymentsWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentListInner listDeployments( + String resourceGroupName, String serviceName, String buildServiceName, String builderName); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServicesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServicesClient.java new file mode 100644 index 0000000000000..dd334baa657ad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServicesClient.java @@ -0,0 +1,642 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.BuildInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultLogInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStacksCollectionInner; + +/** An instance of this class provides access to all the operations defined in BuildServicesClient. */ +public interface BuildServicesClient { + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuildServices(String resourceGroupName, String serviceName); + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuildServices(String resourceGroupName, String serviceName, Context context); + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildServiceWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildServiceInner getBuildService(String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create 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 build service resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService); + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of build service resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + Context context); + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create 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 build service resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildServiceInner createOrUpdate( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService); + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildServiceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + Context context); + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuilds(String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuilds( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildInner getBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build resource payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateBuildWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + BuildInner build, + Context context); + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update 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 build resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildInner createOrUpdateBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, BuildInner build); + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildResultWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context); + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildResultInner getBuildResult( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName); + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildResultLogWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context); + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildResultLogInner getBuildResultLog( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName); + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ResourceUploadDefinitionInner getResourceUploadUrl( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSupportedBuildpacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedBuildpacksCollectionInner listSupportedBuildpacks( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSupportedBuildpackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName, Context context); + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedBuildpackResourceInner getSupportedBuildpack( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName); + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSupportedStacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedStacksCollectionInner listSupportedStacks( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSupportedStackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String stackName, Context context); + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportedStackResourceInner getSupportedStack( + String resourceGroupName, String serviceName, String buildServiceName, String stackName); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildpackBindingsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildpackBindingsClient.java new file mode 100644 index 0000000000000..629c262cf1b52 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildpackBindingsClient.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.BuildpackBindingResourceInner; + +/** An instance of this class provides access to all the operations defined in BuildpackBindingsClient. */ +public interface BuildpackBindingsClient { + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForCluster(String resourceGroupName, String serviceName); + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForCluster( + String resourceGroupName, String serviceName, Context context); + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 a buildpack binding by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context); + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 a buildpack binding by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildpackBindingResourceInner get( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName); + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update 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 buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildpackBindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding); + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, BuildpackBindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + Context context); + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update 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 buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildpackBindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding); + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BuildpackBindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + Context context); + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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> beginDelete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName); + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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> beginDelete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context); + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName); + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context); + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CertificatesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CertificatesClient.java new file mode 100644 index 0000000000000..b8b17ab05b8a1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CertificatesClient.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.CertificateResourceInner; + +/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +public interface CertificatesClient { + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String certificateName, Context context); + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateResourceInner get(String resourceGroupName, String serviceName, String certificateName); + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update 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 certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CertificateResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource); + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CertificateResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context); + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update 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 certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource); + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CertificateResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String certificateName); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String certificateName, Context context); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String certificateName); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String certificateName, Context context); + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigServersClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigServersClient.java new file mode 100644 index 0000000000000..fa06193193e45 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigServersClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; + +/** An instance of this class provides access to all the operations defined in ConfigServersClient. */ +public interface ConfigServersClient { + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerResourceInner get(String resourceGroupName, String serviceName); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerResourceInner updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerResourceInner updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerResourceInner updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerResourceInner updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context); + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServerSettingsValidateResultInner> + beginValidate(String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings); + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigServerSettingsValidateResultInner> + beginValidate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context); + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerSettingsValidateResultInner validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings); + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigServerSettingsValidateResultInner validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigurationServicesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigurationServicesClient.java new file mode 100644 index 0000000000000..7f28ab4de4557 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigurationServicesClient.java @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; + +/** An instance of this class provides access to all the operations defined in ConfigurationServicesClient. */ +public interface ConfigurationServicesClient { + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @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 Application Configuration Service and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String configurationServiceName, Context context); + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceResourceInner get( + String resourceGroupName, String serviceName, String configurationServiceName); + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update 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 application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource); + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ConfigurationServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context); + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update 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 application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource); + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context); + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String configurationServiceName); + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @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 serviceName, String configurationServiceName, Context context); + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String configurationServiceName); + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @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 serviceName, String configurationServiceName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, Context context); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceSettingsValidateResultInner validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceSettingsValidateResultInner validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceSettingsValidateResultInner validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConfigurationServiceSettingsValidateResultInner validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ContainerRegistriesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ContainerRegistriesClient.java new file mode 100644 index 0000000000000..5ff405dac6549 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ContainerRegistriesClient.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ContainerRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; + +/** An instance of this class provides access to all the operations defined in ContainerRegistriesClient. */ +public interface ContainerRegistriesClient { + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @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 container registries resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String containerRegistryName, Context context); + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerRegistryResourceInner get(String resourceGroupName, String serviceName, String containerRegistryName); + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update 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 container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource); + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + Context context); + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update 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 container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerRegistryResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource); + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerRegistryResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + Context context); + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String containerRegistryName); + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @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 serviceName, String containerRegistryName, Context context); + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String containerRegistryName); + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @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 serviceName, String containerRegistryName, Context context); + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate 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 validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerRegistryValidateResultInner> beginValidate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties); + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerRegistryValidateResultInner> beginValidate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context); + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate 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 validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerRegistryValidateResultInner validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties); + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerRegistryValidateResultInner validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomDomainsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomDomainsClient.java new file mode 100644 index 0000000000000..6b902a5467566 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomDomainsClient.java @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.CustomDomainResourceInner; + +/** An instance of this class provides access to all the operations defined in CustomDomainsClient. */ +public interface CustomDomainsClient { + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String domainName, Context context); + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainResourceInner get(String resourceGroupName, String serviceName, String appName, String domainName); + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource); + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context); + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource); + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String domainName); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String domainName, Context context); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, String domainName); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, String domainName, Context context); + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource); + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomDomainResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context); + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource); + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context); + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String appName); + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomizedAcceleratorsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomizedAcceleratorsClient.java new file mode 100644 index 0000000000000..47bba603b6ed2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomizedAcceleratorsClient.java @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; + +/** An instance of this class provides access to all the operations defined in CustomizedAcceleratorsClient. */ +public interface CustomizedAcceleratorsClient { + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName); + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @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 customized accelerator along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context); + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomizedAcceleratorResourceInner get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName); + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update 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 customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomizedAcceleratorResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource); + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CustomizedAcceleratorResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + Context context); + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update 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 customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomizedAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource); + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomizedAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + Context context); + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName); + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context); + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName); + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context); + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @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 validation result for customized accelerator properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties, + Context context); + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomizedAcceleratorValidateResultInner validate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DeploymentsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DeploymentsClient.java new file mode 100644 index 0000000000000..1f6172c5145ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DeploymentsClient.java @@ -0,0 +1,1071 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.RemoteDebuggingInner; +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebuggingPayload; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +public interface DeploymentsClient { + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentResourceInner get(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource); + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context); + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource); + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context); + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource); + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context); + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource); + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, String appName); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String serviceName, + String appName, + List version, + String expand, + Context context); + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForCluster(String resourceGroupName, String serviceName); + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, String expand, Context context); + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RemoteDebuggingInner> beginEnableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @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 remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RemoteDebuggingInner> beginEnableRemoteDebugging( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context); + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RemoteDebuggingInner enableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @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 remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RemoteDebuggingInner enableRemoteDebugging( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context); + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RemoteDebuggingInner> beginDisableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RemoteDebuggingInner> beginDisableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RemoteDebuggingInner disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RemoteDebuggingInner disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRemoteDebuggingConfigWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RemoteDebuggingInner getRemoteDebuggingConfig( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLogFileUrlWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LogFileUrlResponseInner getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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> beginGenerateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGenerateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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 generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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> beginGenerateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGenerateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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 generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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> beginStartJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStartJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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 startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DevToolPortalsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DevToolPortalsClient.java new file mode 100644 index 0000000000000..ababae4f0e463 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DevToolPortalsClient.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.DevToolPortalResourceInner; + +/** An instance of this class provides access to all the operations defined in DevToolPortalsClient. */ +public interface DevToolPortalsClient { + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @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 Application Live and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String devToolPortalName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevToolPortalResourceInner get(String resourceGroupName, String serviceName, String devToolPortalName); + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update 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 dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevToolPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource); + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, DevToolPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + Context context); + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update 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 dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevToolPortalResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource); + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DevToolPortalResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + Context context); + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String devToolPortalName); + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @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 serviceName, String devToolPortalName, Context context); + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String devToolPortalName); + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @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 serviceName, String devToolPortalName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/EurekaServersClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/EurekaServersClient.java new file mode 100644 index 0000000000000..69c3ea7fb6fc0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/EurekaServersClient.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.EurekaServerResourceCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; + +/** An instance of this class provides access to all the operations defined in EurekaServersClient. */ +public interface EurekaServersClient { + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EurekaServerResourceCollectionInner list(String resourceGroupName, String serviceName); + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EurekaServerResourceInner get(String resourceGroupName, String serviceName); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EurekaServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EurekaServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EurekaServerResourceInner updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EurekaServerResourceInner updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EurekaServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, EurekaServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EurekaServerResourceInner updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EurekaServerResourceInner updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayCustomDomainsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayCustomDomainsClient.java new file mode 100644 index 0000000000000..9dd1bafeb16de --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayCustomDomainsClient.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; + +/** An instance of this class provides access to all the operations defined in GatewayCustomDomainsClient. */ +public interface GatewayCustomDomainsClient { + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @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 Spring Cloud Gateway custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String domainName, Context context); + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayCustomDomainResourceInner get( + String resourceGroupName, String serviceName, String gatewayName, String domainName); + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update 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 custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayCustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource); + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayCustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context); + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update 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 custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource); + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String gatewayName, String domainName); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @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 serviceName, String gatewayName, String domainName, Context context); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayName, String domainName); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @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 serviceName, String gatewayName, String domainName, Context context); + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName); + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayRouteConfigsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayRouteConfigsClient.java new file mode 100644 index 0000000000000..168241038cc22 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayRouteConfigsClient.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; + +/** An instance of this class provides access to all the operations defined in GatewayRouteConfigsClient. */ +public interface GatewayRouteConfigsClient { + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @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 Spring Cloud Gateway route configs along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, Context context); + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteConfigResourceInner get( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName); + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update 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 spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayRouteConfigResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource); + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayRouteConfigResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context); + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update 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 spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteConfigResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource); + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayRouteConfigResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String gatewayName, String routeConfigName); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @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 serviceName, String gatewayName, String routeConfigName, Context context); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayName, String routeConfigName); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @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 serviceName, String gatewayName, String routeConfigName, Context context); + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName); + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewaysClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewaysClient.java new file mode 100644 index 0000000000000..8040684de8c03 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewaysClient.java @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.SkuObject; +import java.util.Map; + +/** An instance of this class provides access to all the operations defined in GatewaysClient. */ +public interface GatewaysClient { + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 Spring Cloud Gateway and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceInner get(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource); + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context); + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource); + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context); + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayResourceInner> beginUpdateCapacity( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource); + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GatewayResourceInner> beginUpdateCapacity( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + Context context); + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceInner updateCapacity( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource); + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GatewayResourceInner updateCapacity( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + Context context); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String gatewayName); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 serviceName, String gatewayName, Context context); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayName); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 serviceName, String gatewayName, Context context); + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 sensitive properties for Spring Cloud Gateway along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listEnvSecretsWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Map listEnvSecrets(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginRestart(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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> beginRestart( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 restart(String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String gatewayName, + CustomDomainValidatePayload validatePayload, + Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CustomDomainValidateResultInner validateDomain( + String resourceGroupName, String serviceName, String gatewayName, CustomDomainValidatePayload validatePayload); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/MonitoringSettingsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/MonitoringSettingsClient.java new file mode 100644 index 0000000000000..1bde6a4b54a5e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/MonitoringSettingsClient.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.MonitoringSettingResourceInner; + +/** An instance of this class provides access to all the operations defined in MonitoringSettingsClient. */ +public interface MonitoringSettingsClient { + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringSettingResourceInner get(String resourceGroupName, String serviceName); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoringSettingResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoringSettingResourceInner> beginUpdatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringSettingResourceInner updatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringSettingResourceInner updatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoringSettingResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MonitoringSettingResourceInner> beginUpdatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringSettingResourceInner updatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MonitoringSettingResourceInner updatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/OperationsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/OperationsClient.java new file mode 100644 index 0000000000000..99aa1e7e50221 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.OperationDetailInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @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 available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/PredefinedAcceleratorsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/PredefinedAcceleratorsClient.java new file mode 100644 index 0000000000000..a530f4b4f0881 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/PredefinedAcceleratorsClient.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner; + +/** An instance of this class provides access to all the operations defined in PredefinedAcceleratorsClient. */ +public interface PredefinedAcceleratorsClient { + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName); + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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 predefined accelerator along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PredefinedAcceleratorResourceInner get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginDisable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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> beginDisable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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 disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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> beginEnable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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> beginEnable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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 enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/RuntimeVersionsClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/RuntimeVersionsClient.java new file mode 100644 index 0000000000000..77faf46da5ee9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/RuntimeVersionsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AvailableRuntimeVersionsInner; + +/** An instance of this class provides access to all the operations defined in RuntimeVersionsClient. */ +public interface RuntimeVersionsClient { + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @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 body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listRuntimeVersionsWithResponse(Context context); + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws com.azure.core.management.exception.ManagementException 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) + AvailableRuntimeVersionsInner listRuntimeVersions(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServiceRegistriesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServiceRegistriesClient.java new file mode 100644 index 0000000000000..5b25816647056 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServiceRegistriesClient.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ServiceRegistryResourceInner; + +/** An instance of this class provides access to all the operations defined in ServiceRegistriesClient. */ +public interface ServiceRegistriesClient { + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 Service Registry and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context); + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceRegistryResourceInner get(String resourceGroupName, String serviceName, String serviceRegistryName); + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName); + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context); + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceRegistryResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName); + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceRegistryResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context); + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 serviceName, String serviceRegistryName); + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 serviceName, String serviceRegistryName, Context context); + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String serviceRegistryName); + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 serviceName, String serviceRegistryName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServicesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServicesClient.java new file mode 100644 index 0000000000000..8d68e770fcd7f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServicesClient.java @@ -0,0 +1,845 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.GloballyEnabledApmsInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.NameAvailabilityParameters; +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; + +/** An instance of this class provides access to all the operations defined in ServicesClient. */ +public interface ServicesClient { + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update 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 service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource); + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context); + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update 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 service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner createOrUpdate(String resourceGroupName, String serviceName, ServiceResourceInner resource); + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context); + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName); + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName, Context context); + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName); + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, Context context); + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update 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 service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource); + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context); + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update 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 service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner update(String resourceGroupName, String serviceName, ServiceResourceInner resource); + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner update( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context); + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listTestKeysWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestKeysInner listTestKeys(String resourceGroupName, String serviceName); + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateTestKeyWithResponse( + String resourceGroupName, + String serviceName, + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + Context context); + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the 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 test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestKeysInner regenerateTestKey( + String resourceGroupName, String serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest); + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response disableTestEndpointWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableTestEndpoint(String resourceGroupName, String serviceName); + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response enableTestEndpointWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TestKeysInner enableTestEndpoint(String resourceGroupName, String serviceName); + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @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> beginStop(String resourceGroupName, String serviceName); + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @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> beginStop(String resourceGroupName, String serviceName, Context context); + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String serviceName); + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String serviceName, Context context); + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @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> beginStart(String resourceGroupName, String serviceName); + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @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> beginStart(String resourceGroupName, String serviceName, Context context); + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String serviceName); + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String serviceName, Context context); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFlushVnetDnsSetting(String resourceGroupName, String serviceName); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginFlushVnetDnsSetting( + String resourceGroupName, String serviceName, Context context); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void flushVnetDnsSetting(String resourceGroupName, String serviceName); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void flushVnetDnsSetting(String resourceGroupName, String serviceName, Context context); + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSupportedApmTypes(String resourceGroupName, String serviceName); + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSupportedApmTypes( + String resourceGroupName, String serviceName, Context context); + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listGloballyEnabledApmsWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GloballyEnabledApmsInner listGloballyEnabledApms(String resourceGroupName, String serviceName); + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable 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> beginEnableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm); + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginEnableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm, Context context); + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable 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 enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm); + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context); + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable 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> beginDisableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm); + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDisableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm, Context context); + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable 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 disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm); + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters availabilityParameters, Context context); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the 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 name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityInner checkNameAvailability(String location, NameAvailabilityParameters availabilityParameters); + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName); + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/SkusClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/SkusClient.java new file mode 100644 index 0000000000000..b25962d2ef310 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/SkusClient.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.appplatform.generated.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.appplatform.generated.fluent.models.ResourceSkuInner; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public interface SkusClient { + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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 object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/StoragesClient.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/StoragesClient.java new file mode 100644 index 0000000000000..40edf72dc6b3a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/StoragesClient.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.StorageResourceInner; + +/** An instance of this class provides access to all the operations defined in StoragesClient. */ +public interface StoragesClient { + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String serviceName, String storageName, Context context); + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageResourceInner get(String resourceGroupName, String serviceName, String storageName); + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update 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 storage resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource); + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of storage resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, StorageResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context); + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update 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 storage resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource); + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context); + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName, String storageName); + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String storageName, Context context); + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String storageName); + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String serviceName, String storageName, Context context); + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApiPortalCustomDomainResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApiPortalCustomDomainResourceInner.java new file mode 100644 index 0000000000000..9d4ada318116f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApiPortalCustomDomainResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain of the API portal. */ +@Fluent +public final class ApiPortalCustomDomainResourceInner extends ProxyResource { + /* + * The properties of custom domain for API portal + */ + @JsonProperty(value = "properties") + private ApiPortalCustomDomainProperties properties; + + /* + * 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 ApiPortalCustomDomainResourceInner class. */ + public ApiPortalCustomDomainResourceInner() { + } + + /** + * Get the properties property: The properties of custom domain for API portal. + * + * @return the properties value. + */ + public ApiPortalCustomDomainProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of custom domain for API portal. + * + * @param properties the properties value to set. + * @return the ApiPortalCustomDomainResourceInner object itself. + */ + public ApiPortalCustomDomainResourceInner withProperties(ApiPortalCustomDomainProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApiPortalResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApiPortalResourceInner.java new file mode 100644 index 0000000000000..e9cac64a12b6f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApiPortalResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** API portal resource. */ +@Fluent +public final class ApiPortalResourceInner extends ProxyResource { + /* + * API portal properties payload + */ + @JsonProperty(value = "properties") + private ApiPortalProperties properties; + + /* + * Sku of the API portal 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 ApiPortalResourceInner class. */ + public ApiPortalResourceInner() { + } + + /** + * Get the properties property: API portal properties payload. + * + * @return the properties value. + */ + public ApiPortalProperties properties() { + return this.properties; + } + + /** + * Set the properties property: API portal properties payload. + * + * @param properties the properties value to set. + * @return the ApiPortalResourceInner object itself. + */ + public ApiPortalResourceInner withProperties(ApiPortalProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the API portal resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the API portal resource. + * + * @param sku the sku value to set. + * @return the ApiPortalResourceInner object itself. + */ + public ApiPortalResourceInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApmResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApmResourceInner.java new file mode 100644 index 0000000000000..58b1b6140df31 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApmResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ApmProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** APM Resource object. */ +@Fluent +public final class ApmResourceInner extends ProxyResource { + /* + * Properties of an APM + */ + @JsonProperty(value = "properties") + private ApmProperties properties; + + /* + * 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 ApmResourceInner class. */ + public ApmResourceInner() { + } + + /** + * Get the properties property: Properties of an APM. + * + * @return the properties value. + */ + public ApmProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of an APM. + * + * @param properties the properties value to set. + * @return the ApmResourceInner object itself. + */ + public ApmResourceInner withProperties(ApmProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApmSecretKeysInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApmSecretKeysInner.java new file mode 100644 index 0000000000000..b1959d58ec333 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApmSecretKeysInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Keys of APM sensitive properties. */ +@Fluent +public final class ApmSecretKeysInner { + /* + * Collection of the keys for the APM sensitive properties + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of ApmSecretKeysInner class. */ + public ApmSecretKeysInner() { + } + + /** + * Get the value property: Collection of the keys for the APM sensitive properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of the keys for the APM sensitive properties. + * + * @param value the value value to set. + * @return the ApmSecretKeysInner object itself. + */ + public ApmSecretKeysInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AppResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AppResourceInner.java new file mode 100644 index 0000000000000..b28d01befeea0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AppResourceInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** App resource payload. */ +@Fluent +public final class AppResourceInner extends ProxyResource { + /* + * Properties of the App resource + */ + @JsonProperty(value = "properties") + private AppResourceProperties properties; + + /* + * The Managed Identity type of the app resource + */ + @JsonProperty(value = "identity") + private ManagedIdentityProperties identity; + + /* + * The GEO location of the application, always the same with its parent resource + */ + @JsonProperty(value = "location") + private String location; + + /* + * 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 AppResourceInner class. */ + public AppResourceInner() { + } + + /** + * Get the properties property: Properties of the App resource. + * + * @return the properties value. + */ + public AppResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the App resource. + * + * @param properties the properties value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withProperties(AppResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the identity property: The Managed Identity type of the app resource. + * + * @return the identity value. + */ + public ManagedIdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity property: The Managed Identity type of the app resource. + * + * @param identity the identity value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withIdentity(ManagedIdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the location property: The GEO location of the application, always the same with its parent resource. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The GEO location of the application, always the same with its parent resource. + * + * @param location the location value to set. + * @return the AppResourceInner object itself. + */ + public AppResourceInner withLocation(String location) { + this.location = location; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApplicationAcceleratorResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApplicationAcceleratorResourceInner.java new file mode 100644 index 0000000000000..740b5b2eb596d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApplicationAcceleratorResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application accelerator resource. */ +@Fluent +public final class ApplicationAcceleratorResourceInner extends ProxyResource { + /* + * Application accelerator properties payload + */ + @JsonProperty(value = "properties") + private ApplicationAcceleratorProperties properties; + + /* + * Sku of the application accelerator 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 ApplicationAcceleratorResourceInner class. */ + public ApplicationAcceleratorResourceInner() { + } + + /** + * Get the properties property: Application accelerator properties payload. + * + * @return the properties value. + */ + public ApplicationAcceleratorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Application accelerator properties payload. + * + * @param properties the properties value to set. + * @return the ApplicationAcceleratorResourceInner object itself. + */ + public ApplicationAcceleratorResourceInner withProperties(ApplicationAcceleratorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the application accelerator resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the application accelerator resource. + * + * @param sku the sku value to set. + * @return the ApplicationAcceleratorResourceInner object itself. + */ + public ApplicationAcceleratorResourceInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApplicationLiveViewResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApplicationLiveViewResourceInner.java new file mode 100644 index 0000000000000..d38c56503a32a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ApplicationLiveViewResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Live View resource. */ +@Fluent +public final class ApplicationLiveViewResourceInner extends ProxyResource { + /* + * Application Live View properties payload + */ + @JsonProperty(value = "properties") + private ApplicationLiveViewProperties properties; + + /* + * 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 ApplicationLiveViewResourceInner class. */ + public ApplicationLiveViewResourceInner() { + } + + /** + * Get the properties property: Application Live View properties payload. + * + * @return the properties value. + */ + public ApplicationLiveViewProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Application Live View properties payload. + * + * @param properties the properties value to set. + * @return the ApplicationLiveViewResourceInner object itself. + */ + public ApplicationLiveViewResourceInner withProperties(ApplicationLiveViewProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AvailableRuntimeVersionsInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AvailableRuntimeVersionsInner.java new file mode 100644 index 0000000000000..41864c6bc7148 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AvailableRuntimeVersionsInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.appplatform.generated.models.SupportedRuntimeVersion; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The AvailableRuntimeVersions model. */ +@Immutable +public final class AvailableRuntimeVersionsInner { + /* + * A list of all supported runtime versions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of AvailableRuntimeVersionsInner class. */ + public AvailableRuntimeVersionsInner() { + } + + /** + * Get the value property: A list of all supported runtime versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BindingResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BindingResourceInner.java new file mode 100644 index 0000000000000..8dc4340bfe96a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BindingResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Binding resource payload. */ +@Fluent +public final class BindingResourceInner extends ProxyResource { + /* + * Properties of the Binding resource + */ + @JsonProperty(value = "properties") + private BindingResourceProperties properties; + + /* + * 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 BindingResourceInner class. */ + public BindingResourceInner() { + } + + /** + * Get the properties property: Properties of the Binding resource. + * + * @return the properties value. + */ + public BindingResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Binding resource. + * + * @param properties the properties value to set. + * @return the BindingResourceInner object itself. + */ + public BindingResourceInner withProperties(BindingResourceProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildInner.java new file mode 100644 index 0000000000000..8d931d501e5f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BuildProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build resource payload. */ +@Fluent +public final class BuildInner extends ProxyResource { + /* + * Properties of the build resource + */ + @JsonProperty(value = "properties") + private BuildProperties properties; + + /* + * 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 BuildInner class. */ + public BuildInner() { + } + + /** + * Get the properties property: Properties of the build resource. + * + * @return the properties value. + */ + public BuildProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the build resource. + * + * @param properties the properties value to set. + * @return the BuildInner object itself. + */ + public BuildInner withProperties(BuildProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildResultInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildResultInner.java new file mode 100644 index 0000000000000..6b86bb7fd1a24 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildResultInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build result resource payload. */ +@Fluent +public final class BuildResultInner extends ProxyResource { + /* + * Properties of the build result resource + */ + @JsonProperty(value = "properties") + private BuildResultProperties properties; + + /* + * 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 BuildResultInner class. */ + public BuildResultInner() { + } + + /** + * Get the properties property: Properties of the build result resource. + * + * @return the properties value. + */ + public BuildResultProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the build result resource. + * + * @param properties the properties value to set. + * @return the BuildResultInner object itself. + */ + public BuildResultInner withProperties(BuildResultProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildResultLogInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildResultLogInner.java new file mode 100644 index 0000000000000..7b1d595958377 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildResultLogInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build result log resource properties payload. */ +@Fluent +public final class BuildResultLogInner { + /* + * The public download URL of this build result log + */ + @JsonProperty(value = "blobUrl") + private String blobUrl; + + /** Creates an instance of BuildResultLogInner class. */ + public BuildResultLogInner() { + } + + /** + * Get the blobUrl property: The public download URL of this build result log. + * + * @return the blobUrl value. + */ + public String blobUrl() { + return this.blobUrl; + } + + /** + * Set the blobUrl property: The public download URL of this build result log. + * + * @param blobUrl the blobUrl value to set. + * @return the BuildResultLogInner object itself. + */ + public BuildResultLogInner withBlobUrl(String blobUrl) { + this.blobUrl = blobUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildServiceAgentPoolResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildServiceAgentPoolResourceInner.java new file mode 100644 index 0000000000000..4fda8bd4428af --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildServiceAgentPoolResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The build service agent pool resource. */ +@Fluent +public final class BuildServiceAgentPoolResourceInner extends ProxyResource { + /* + * build service agent pool properties + */ + @JsonProperty(value = "properties") + private BuildServiceAgentPoolProperties properties; + + /* + * 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 BuildServiceAgentPoolResourceInner class. */ + public BuildServiceAgentPoolResourceInner() { + } + + /** + * Get the properties property: build service agent pool properties. + * + * @return the properties value. + */ + public BuildServiceAgentPoolProperties properties() { + return this.properties; + } + + /** + * Set the properties property: build service agent pool properties. + * + * @param properties the properties value to set. + * @return the BuildServiceAgentPoolResourceInner object itself. + */ + public BuildServiceAgentPoolResourceInner withProperties(BuildServiceAgentPoolProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildServiceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildServiceInner.java new file mode 100644 index 0000000000000..958206cb4c494 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildServiceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service resource payload. */ +@Fluent +public final class BuildServiceInner extends ProxyResource { + /* + * Properties of the build resource + */ + @JsonProperty(value = "properties") + private BuildServiceProperties properties; + + /* + * 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 BuildServiceInner class. */ + public BuildServiceInner() { + } + + /** + * Get the properties property: Properties of the build resource. + * + * @return the properties value. + */ + public BuildServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the build resource. + * + * @param properties the properties value to set. + * @return the BuildServiceInner object itself. + */ + public BuildServiceInner withProperties(BuildServiceProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuilderResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuilderResourceInner.java new file mode 100644 index 0000000000000..97cd1459857f9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuilderResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BuilderProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KPack Builder resource. */ +@Fluent +public final class BuilderResourceInner extends ProxyResource { + /* + * Property of the Builder resource. + */ + @JsonProperty(value = "properties") + private BuilderProperties properties; + + /* + * 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 BuilderResourceInner class. */ + public BuilderResourceInner() { + } + + /** + * Get the properties property: Property of the Builder resource. + * + * @return the properties value. + */ + public BuilderProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Property of the Builder resource. + * + * @param properties the properties value to set. + * @return the BuilderResourceInner object itself. + */ + public BuilderResourceInner withProperties(BuilderProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildpackBindingResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildpackBindingResourceInner.java new file mode 100644 index 0000000000000..a02b1b452cb97 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/BuildpackBindingResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Buildpack Binding Resource object. */ +@Fluent +public final class BuildpackBindingResourceInner extends ProxyResource { + /* + * Properties of a buildpack binding + */ + @JsonProperty(value = "properties") + private BuildpackBindingProperties properties; + + /* + * 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 BuildpackBindingResourceInner class. */ + public BuildpackBindingResourceInner() { + } + + /** + * Get the properties property: Properties of a buildpack binding. + * + * @return the properties value. + */ + public BuildpackBindingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a buildpack binding. + * + * @param properties the properties value to set. + * @return the BuildpackBindingResourceInner object itself. + */ + public BuildpackBindingResourceInner withProperties(BuildpackBindingProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CertificateResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CertificateResourceInner.java new file mode 100644 index 0000000000000..413d184f07824 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CertificateResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate resource payload. */ +@Fluent +public final class CertificateResourceInner extends ProxyResource { + /* + * Properties of the certificate resource payload. + */ + @JsonProperty(value = "properties") + private CertificateProperties properties; + + /* + * 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 CertificateResourceInner class. */ + public CertificateResourceInner() { + } + + /** + * Get the properties property: Properties of the certificate resource payload. + * + * @return the properties value. + */ + public CertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the certificate resource payload. + * + * @param properties the properties value to set. + * @return the CertificateResourceInner object itself. + */ + public CertificateResourceInner withProperties(CertificateProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerResourceInner.java new file mode 100644 index 0000000000000..994d473c52d47 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Config Server resource. */ +@Fluent +public final class ConfigServerResourceInner extends ProxyResource { + /* + * Properties of the Config Server resource + */ + @JsonProperty(value = "properties") + private ConfigServerProperties properties; + + /* + * 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 ConfigServerResourceInner class. */ + public ConfigServerResourceInner() { + } + + /** + * Get the properties property: Properties of the Config Server resource. + * + * @return the properties value. + */ + public ConfigServerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Config Server resource. + * + * @param properties the properties value to set. + * @return the ConfigServerResourceInner object itself. + */ + public ConfigServerResourceInner withProperties(ConfigServerProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerSettingsValidateResultInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerSettingsValidateResultInner.java new file mode 100644 index 0000000000000..f3868e4fd2cfd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerSettingsValidateResultInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettingsErrorRecord; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validation result for config server settings. */ +@Fluent +public final class ConfigServerSettingsValidateResultInner { + /* + * Indicate if the config server settings are valid + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * The detail validation results + */ + @JsonProperty(value = "details") + private List details; + + /** Creates an instance of ConfigServerSettingsValidateResultInner class. */ + public ConfigServerSettingsValidateResultInner() { + } + + /** + * Get the isValid property: Indicate if the config server settings are valid. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set the isValid property: Indicate if the config server settings are valid. + * + * @param isValid the isValid value to set. + * @return the ConfigServerSettingsValidateResultInner object itself. + */ + public ConfigServerSettingsValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the details property: The detail validation results. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Set the details property: The detail validation results. + * + * @param details the details value to set. + * @return the ConfigServerSettingsValidateResultInner object itself. + */ + public ConfigServerSettingsValidateResultInner withDetails(List details) { + this.details = details; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceResourceInner.java new file mode 100644 index 0000000000000..f6cf5df679464 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Configuration Service resource. */ +@Fluent +public final class ConfigurationServiceResourceInner extends ProxyResource { + /* + * Application Configuration Service properties payload + */ + @JsonProperty(value = "properties") + private ConfigurationServiceProperties properties; + + /* + * 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 ConfigurationServiceResourceInner class. */ + public ConfigurationServiceResourceInner() { + } + + /** + * Get the properties property: Application Configuration Service properties payload. + * + * @return the properties value. + */ + public ConfigurationServiceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Application Configuration Service properties payload. + * + * @param properties the properties value to set. + * @return the ConfigurationServiceResourceInner object itself. + */ + public ConfigurationServiceResourceInner withProperties(ConfigurationServiceProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceSettingsValidateResultInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceSettingsValidateResultInner.java new file mode 100644 index 0000000000000..873e18360402a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceSettingsValidateResultInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitPropertyValidateResult; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation result for configuration service settings. */ +@Fluent +public final class ConfigurationServiceSettingsValidateResultInner { + /* + * Validation result for configuration service settings + */ + @JsonProperty(value = "gitPropertyValidationResult") + private ConfigurationServiceGitPropertyValidateResult gitPropertyValidationResult; + + /** Creates an instance of ConfigurationServiceSettingsValidateResultInner class. */ + public ConfigurationServiceSettingsValidateResultInner() { + } + + /** + * Get the gitPropertyValidationResult property: Validation result for configuration service settings. + * + * @return the gitPropertyValidationResult value. + */ + public ConfigurationServiceGitPropertyValidateResult gitPropertyValidationResult() { + return this.gitPropertyValidationResult; + } + + /** + * Set the gitPropertyValidationResult property: Validation result for configuration service settings. + * + * @param gitPropertyValidationResult the gitPropertyValidationResult value to set. + * @return the ConfigurationServiceSettingsValidateResultInner object itself. + */ + public ConfigurationServiceSettingsValidateResultInner withGitPropertyValidationResult( + ConfigurationServiceGitPropertyValidateResult gitPropertyValidationResult) { + this.gitPropertyValidationResult = gitPropertyValidationResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitPropertyValidationResult() != null) { + gitPropertyValidationResult().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ContainerRegistryResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ContainerRegistryResourceInner.java new file mode 100644 index 0000000000000..c232c934c96ff --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ContainerRegistryResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container registry resource payload. */ +@Fluent +public final class ContainerRegistryResourceInner extends ProxyResource { + /* + * Properties of the container registry resource payload. + */ + @JsonProperty(value = "properties") + private ContainerRegistryProperties properties; + + /* + * 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 ContainerRegistryResourceInner class. */ + public ContainerRegistryResourceInner() { + } + + /** + * Get the properties property: Properties of the container registry resource payload. + * + * @return the properties value. + */ + public ContainerRegistryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the container registry resource payload. + * + * @param properties the properties value to set. + * @return the ContainerRegistryResourceInner object itself. + */ + public ContainerRegistryResourceInner withProperties(ContainerRegistryProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ContainerRegistryValidateResultInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ContainerRegistryValidateResultInner.java new file mode 100644 index 0000000000000..7ab8e97d93cf3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ContainerRegistryValidateResultInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation result for container registry properties. */ +@Fluent +public final class ContainerRegistryValidateResultInner { + /* + * Indicate if the container registry properties are valid + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * Detailed validation messages. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of ContainerRegistryValidateResultInner class. */ + public ContainerRegistryValidateResultInner() { + } + + /** + * Get the isValid property: Indicate if the container registry properties are valid. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set the isValid property: Indicate if the container registry properties are valid. + * + * @param isValid the isValid value to set. + * @return the ContainerRegistryValidateResultInner object itself. + */ + public ContainerRegistryValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the message property: Detailed validation messages. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Detailed validation messages. + * + * @param message the message value to set. + * @return the ContainerRegistryValidateResultInner object itself. + */ + public ContainerRegistryValidateResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomDomainResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomDomainResourceInner.java new file mode 100644 index 0000000000000..8beda874d3357 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomDomainResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain resource payload. */ +@Fluent +public final class CustomDomainResourceInner extends ProxyResource { + /* + * Properties of the custom domain resource. + */ + @JsonProperty(value = "properties") + private CustomDomainProperties properties; + + /* + * 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 CustomDomainResourceInner class. */ + public CustomDomainResourceInner() { + } + + /** + * Get the properties property: Properties of the custom domain resource. + * + * @return the properties value. + */ + public CustomDomainProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the custom domain resource. + * + * @param properties the properties value to set. + * @return the CustomDomainResourceInner object itself. + */ + public CustomDomainResourceInner withProperties(CustomDomainProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomDomainValidateResultInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomDomainValidateResultInner.java new file mode 100644 index 0000000000000..d691a4c69659c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomDomainValidateResultInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation result for custom domain. */ +@Fluent +public final class CustomDomainValidateResultInner { + /* + * Indicates if domain name is valid. + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * Message of why domain name is invalid. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of CustomDomainValidateResultInner class. */ + public CustomDomainValidateResultInner() { + } + + /** + * Get the isValid property: Indicates if domain name is valid. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set the isValid property: Indicates if domain name is valid. + * + * @param isValid the isValid value to set. + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the message property: Message of why domain name is invalid. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message of why domain name is invalid. + * + * @param message the message value to set. + * @return the CustomDomainValidateResultInner object itself. + */ + public CustomDomainValidateResultInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomizedAcceleratorResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomizedAcceleratorResourceInner.java new file mode 100644 index 0000000000000..2ad0cf2782b8d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomizedAcceleratorResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Customized accelerator resource. */ +@Fluent +public final class CustomizedAcceleratorResourceInner extends ProxyResource { + /* + * Customized accelerator properties payload + */ + @JsonProperty(value = "properties") + private CustomizedAcceleratorProperties properties; + + /* + * Sku of the customized accelerator 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 CustomizedAcceleratorResourceInner class. */ + public CustomizedAcceleratorResourceInner() { + } + + /** + * Get the properties property: Customized accelerator properties payload. + * + * @return the properties value. + */ + public CustomizedAcceleratorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Customized accelerator properties payload. + * + * @param properties the properties value to set. + * @return the CustomizedAcceleratorResourceInner object itself. + */ + public CustomizedAcceleratorResourceInner withProperties(CustomizedAcceleratorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the customized accelerator resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the customized accelerator resource. + * + * @param sku the sku value to set. + * @return the CustomizedAcceleratorResourceInner object itself. + */ + public CustomizedAcceleratorResourceInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomizedAcceleratorValidateResultInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomizedAcceleratorValidateResultInner.java new file mode 100644 index 0000000000000..c2d58c62c753f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/CustomizedAcceleratorValidateResultInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorValidateResultState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation result for customized accelerator properties. */ +@Fluent +public final class CustomizedAcceleratorValidateResultInner { + /* + * State of the customized accelerator validation result + */ + @JsonProperty(value = "state") + private CustomizedAcceleratorValidateResultState state; + + /* + * The detail validation results + */ + @JsonProperty(value = "errorMessage") + private String errorMessage; + + /** Creates an instance of CustomizedAcceleratorValidateResultInner class. */ + public CustomizedAcceleratorValidateResultInner() { + } + + /** + * Get the state property: State of the customized accelerator validation result. + * + * @return the state value. + */ + public CustomizedAcceleratorValidateResultState state() { + return this.state; + } + + /** + * Set the state property: State of the customized accelerator validation result. + * + * @param state the state value to set. + * @return the CustomizedAcceleratorValidateResultInner object itself. + */ + public CustomizedAcceleratorValidateResultInner withState(CustomizedAcceleratorValidateResultState state) { + this.state = state; + return this; + } + + /** + * Get the errorMessage property: The detail validation results. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Set the errorMessage property: The detail validation results. + * + * @param errorMessage the errorMessage value to set. + * @return the CustomizedAcceleratorValidateResultInner object itself. + */ + public CustomizedAcceleratorValidateResultInner withErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DeploymentListInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DeploymentListInner.java new file mode 100644 index 0000000000000..ace511f0a380a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DeploymentListInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of deployments resource ids. */ +@Fluent +public final class DeploymentListInner { + /* + * A list of deployment resource ids. + */ + @JsonProperty(value = "deployments") + private List deployments; + + /** Creates an instance of DeploymentListInner class. */ + public DeploymentListInner() { + } + + /** + * Get the deployments property: A list of deployment resource ids. + * + * @return the deployments value. + */ + public List deployments() { + return this.deployments; + } + + /** + * Set the deployments property: A list of deployment resource ids. + * + * @param deployments the deployments value to set. + * @return the DeploymentListInner object itself. + */ + public DeploymentListInner withDeployments(List deployments) { + this.deployments = deployments; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DeploymentResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DeploymentResourceInner.java new file mode 100644 index 0000000000000..3e1e9a6c5d217 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DeploymentResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment resource payload. */ +@Fluent +public final class DeploymentResourceInner extends ProxyResource { + /* + * Properties of the Deployment resource + */ + @JsonProperty(value = "properties") + private DeploymentResourceProperties properties; + + /* + * Sku of the Deployment 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 DeploymentResourceInner class. */ + public DeploymentResourceInner() { + } + + /** + * Get the properties property: Properties of the Deployment resource. + * + * @return the properties value. + */ + public DeploymentResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Deployment resource. + * + * @param properties the properties value to set. + * @return the DeploymentResourceInner object itself. + */ + public DeploymentResourceInner withProperties(DeploymentResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the Deployment resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the Deployment resource. + * + * @param sku the sku value to set. + * @return the DeploymentResourceInner object itself. + */ + public DeploymentResourceInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DevToolPortalResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DevToolPortalResourceInner.java new file mode 100644 index 0000000000000..443d6c85ccd11 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/DevToolPortalResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dev Tool Portal resource. */ +@Fluent +public final class DevToolPortalResourceInner extends ProxyResource { + /* + * Dev Tool Portal properties payload + */ + @JsonProperty(value = "properties") + private DevToolPortalProperties properties; + + /* + * 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 DevToolPortalResourceInner class. */ + public DevToolPortalResourceInner() { + } + + /** + * Get the properties property: Dev Tool Portal properties payload. + * + * @return the properties value. + */ + public DevToolPortalProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Dev Tool Portal properties payload. + * + * @param properties the properties value to set. + * @return the DevToolPortalResourceInner object itself. + */ + public DevToolPortalResourceInner withProperties(DevToolPortalProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/EurekaServerResourceCollectionInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/EurekaServerResourceCollectionInner.java new file mode 100644 index 0000000000000..fe4e4d1715bea --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/EurekaServerResourceCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Eureka server resources and a possible link for next set. */ +@Fluent +public final class EurekaServerResourceCollectionInner { + /* + * Collection of Eureka server resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of EurekaServerResourceCollectionInner class. */ + public EurekaServerResourceCollectionInner() { + } + + /** + * Get the value property: Collection of Eureka server resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Eureka server resources. + * + * @param value the value value to set. + * @return the EurekaServerResourceCollectionInner object itself. + */ + public EurekaServerResourceCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the EurekaServerResourceCollectionInner object itself. + */ + public EurekaServerResourceCollectionInner 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/EurekaServerResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/EurekaServerResourceInner.java new file mode 100644 index 0000000000000..3108cf4cdee53 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/EurekaServerResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Eureka server resource. */ +@Fluent +public final class EurekaServerResourceInner extends ProxyResource { + /* + * Properties of the eureka server resource + */ + @JsonProperty(value = "properties") + private EurekaServerProperties properties; + + /* + * 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 EurekaServerResourceInner class. */ + public EurekaServerResourceInner() { + } + + /** + * Get the properties property: Properties of the eureka server resource. + * + * @return the properties value. + */ + public EurekaServerProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the eureka server resource. + * + * @param properties the properties value to set. + * @return the EurekaServerResourceInner object itself. + */ + public EurekaServerResourceInner withProperties(EurekaServerProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayCustomDomainResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayCustomDomainResourceInner.java new file mode 100644 index 0000000000000..834b03ebc8795 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayCustomDomainResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain of the Spring Cloud Gateway. */ +@Fluent +public final class GatewayCustomDomainResourceInner extends ProxyResource { + /* + * The properties of custom domain for Spring Cloud Gateway + */ + @JsonProperty(value = "properties") + private GatewayCustomDomainProperties properties; + + /* + * 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 GatewayCustomDomainResourceInner class. */ + public GatewayCustomDomainResourceInner() { + } + + /** + * Get the properties property: The properties of custom domain for Spring Cloud Gateway. + * + * @return the properties value. + */ + public GatewayCustomDomainProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of custom domain for Spring Cloud Gateway. + * + * @param properties the properties value to set. + * @return the GatewayCustomDomainResourceInner object itself. + */ + public GatewayCustomDomainResourceInner withProperties(GatewayCustomDomainProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayResourceInner.java new file mode 100644 index 0000000000000..a6fb2f29398f0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Spring Cloud Gateway resource. */ +@Fluent +public final class GatewayResourceInner extends ProxyResource { + /* + * Spring Cloud Gateway properties payload + */ + @JsonProperty(value = "properties") + private GatewayProperties properties; + + /* + * Sku of the Spring Cloud Gateway 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 GatewayResourceInner class. */ + public GatewayResourceInner() { + } + + /** + * Get the properties property: Spring Cloud Gateway properties payload. + * + * @return the properties value. + */ + public GatewayProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Spring Cloud Gateway properties payload. + * + * @param properties the properties value to set. + * @return the GatewayResourceInner object itself. + */ + public GatewayResourceInner withProperties(GatewayProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the Spring Cloud Gateway resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the Spring Cloud Gateway resource. + * + * @param sku the sku value to set. + * @return the GatewayResourceInner object itself. + */ + public GatewayResourceInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayRouteConfigResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayRouteConfigResourceInner.java new file mode 100644 index 0000000000000..2a869144284c8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GatewayRouteConfigResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Spring Cloud Gateway route config resource. */ +@Fluent +public final class GatewayRouteConfigResourceInner extends ProxyResource { + /* + * API route config of the Spring Cloud Gateway + */ + @JsonProperty(value = "properties") + private GatewayRouteConfigProperties properties; + + /* + * 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 GatewayRouteConfigResourceInner class. */ + public GatewayRouteConfigResourceInner() { + } + + /** + * Get the properties property: API route config of the Spring Cloud Gateway. + * + * @return the properties value. + */ + public GatewayRouteConfigProperties properties() { + return this.properties; + } + + /** + * Set the properties property: API route config of the Spring Cloud Gateway. + * + * @param properties the properties value to set. + * @return the GatewayRouteConfigResourceInner object itself. + */ + public GatewayRouteConfigResourceInner withProperties(GatewayRouteConfigProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GloballyEnabledApmsInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GloballyEnabledApmsInner.java new file mode 100644 index 0000000000000..7fbbde86e1a41 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/GloballyEnabledApmsInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Globally enabled APMs payload. */ +@Fluent +public final class GloballyEnabledApmsInner { + /* + * Collection of the globally enabled APMs + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of GloballyEnabledApmsInner class. */ + public GloballyEnabledApmsInner() { + } + + /** + * Get the value property: Collection of the globally enabled APMs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of the globally enabled APMs. + * + * @param value the value value to set. + * @return the GloballyEnabledApmsInner object itself. + */ + public GloballyEnabledApmsInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/LogFileUrlResponseInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/LogFileUrlResponseInner.java new file mode 100644 index 0000000000000..0985aa0990569 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/LogFileUrlResponseInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log file URL payload. */ +@Fluent +public final class LogFileUrlResponseInner { + /* + * URL of the log file + */ + @JsonProperty(value = "url", required = true) + private String url; + + /** Creates an instance of LogFileUrlResponseInner class. */ + public LogFileUrlResponseInner() { + } + + /** + * Get the url property: URL of the log file. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: URL of the log file. + * + * @param url the url value to set. + * @return the LogFileUrlResponseInner object itself. + */ + public LogFileUrlResponseInner withUrl(String url) { + this.url = url; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (url() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model LogFileUrlResponseInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LogFileUrlResponseInner.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/MonitoringSettingResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/MonitoringSettingResourceInner.java new file mode 100644 index 0000000000000..72a31bfe9dbbb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/MonitoringSettingResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monitoring Setting resource. */ +@Fluent +public final class MonitoringSettingResourceInner extends ProxyResource { + /* + * Properties of the Monitoring Setting resource + */ + @JsonProperty(value = "properties") + private MonitoringSettingProperties properties; + + /* + * 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 MonitoringSettingResourceInner class. */ + public MonitoringSettingResourceInner() { + } + + /** + * Get the properties property: Properties of the Monitoring Setting resource. + * + * @return the properties value. + */ + public MonitoringSettingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Monitoring Setting resource. + * + * @param properties the properties value to set. + * @return the MonitoringSettingResourceInner object itself. + */ + public MonitoringSettingResourceInner withProperties(MonitoringSettingProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/NameAvailabilityInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/NameAvailabilityInner.java new file mode 100644 index 0000000000000..7719fbc8942ca --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/NameAvailabilityInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name availability result payload. */ +@Fluent +public final class NameAvailabilityInner { + /* + * Indicates whether the name is available + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * Reason why the name is not available + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Message why the name is not available + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of NameAvailabilityInner class. */ + public NameAvailabilityInner() { + } + + /** + * Get the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: Reason why the name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Reason why the name is not available. + * + * @param reason the reason value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Message why the name is not available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Message why the name is not available. + * + * @param message the message value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/OperationDetailInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/OperationDetailInner.java new file mode 100644 index 0000000000000..df8bea402c383 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/OperationDetailInner.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.models.ActionType; +import com.azure.resourcemanager.appplatform.generated.models.OperationDisplay; +import com.azure.resourcemanager.appplatform.generated.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation detail payload. */ +@Fluent +public final class OperationDetailInner { + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * 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; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Properties of the operation + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** Creates an instance of OperationDetailInner class. */ + public OperationDetailInner() { + } + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * 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; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Properties of the operation. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the operation. + * + * @param properties the properties value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/PredefinedAcceleratorResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/PredefinedAcceleratorResourceInner.java new file mode 100644 index 0000000000000..1fb8914147e42 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/PredefinedAcceleratorResourceInner.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Predefined accelerator resource. */ +@Fluent +public final class PredefinedAcceleratorResourceInner extends ProxyResource { + /* + * Predefined accelerator properties payload + */ + @JsonProperty(value = "properties") + private PredefinedAcceleratorProperties properties; + + /* + * Sku of the predefined accelerator 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 PredefinedAcceleratorResourceInner class. */ + public PredefinedAcceleratorResourceInner() { + } + + /** + * Get the properties property: Predefined accelerator properties payload. + * + * @return the properties value. + */ + public PredefinedAcceleratorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Predefined accelerator properties payload. + * + * @param properties the properties value to set. + * @return the PredefinedAcceleratorResourceInner object itself. + */ + public PredefinedAcceleratorResourceInner withProperties(PredefinedAcceleratorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the predefined accelerator resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the predefined accelerator resource. + * + * @param sku the sku value to set. + * @return the PredefinedAcceleratorResourceInner object itself. + */ + public PredefinedAcceleratorResourceInner 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/RemoteDebuggingInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/RemoteDebuggingInner.java new file mode 100644 index 0000000000000..a91615635d9c2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/RemoteDebuggingInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Remote debugging config. */ +@Fluent +public final class RemoteDebuggingInner { + /* + * Application debugging port + */ + @JsonProperty(value = "port") + private Integer port; + + /* + * Indicate if remote debugging is enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** Creates an instance of RemoteDebuggingInner class. */ + public RemoteDebuggingInner() { + } + + /** + * Get the port property: Application debugging port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Application debugging port. + * + * @param port the port value to set. + * @return the RemoteDebuggingInner object itself. + */ + public RemoteDebuggingInner withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Get the enabled property: Indicate if remote debugging is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicate if remote debugging is enabled. + * + * @param enabled the enabled value to set. + * @return the RemoteDebuggingInner object itself. + */ + public RemoteDebuggingInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceSkuInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceSkuInner.java new file mode 100644 index 0000000000000..3d026516da495 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceSkuInner.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSkuLocationInfo; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSkuRestrictions; +import com.azure.resourcemanager.appplatform.generated.models.SkuCapacity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available Azure Spring Apps SKU. */ +@Fluent +public final class ResourceSkuInner { + /* + * Gets the type of resource the SKU applies to. + */ + @JsonProperty(value = "resourceType") + private String resourceType; + + /* + * Gets the name of SKU. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets the tier of SKU. + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Gets the capacity of SKU. + */ + @JsonProperty(value = "capacity") + private SkuCapacity capacity; + + /* + * Gets the set of locations that the SKU is available. + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets a list of locations and availability zones in those locations where the SKU is available. + */ + @JsonProperty(value = "locationInfo") + private List locationInfo; + + /* + * Gets the restrictions because of which SKU cannot be used. This is + * empty if there are no restrictions. + */ + @JsonProperty(value = "restrictions") + private List restrictions; + + /** Creates an instance of ResourceSkuInner class. */ + public ResourceSkuInner() { + } + + /** + * Get the resourceType property: Gets the type of resource the SKU applies to. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType property: Gets the type of resource the SKU applies to. + * + * @param resourceType the resourceType value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get the name property: Gets the name of SKU. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets the name of SKU. + * + * @param name the name value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Gets the tier of SKU. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Gets the tier of SKU. + * + * @param tier the tier value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Gets the capacity of SKU. + * + * @return the capacity value. + */ + public SkuCapacity capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Gets the capacity of SKU. + * + * @param capacity the capacity value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withCapacity(SkuCapacity capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the locations property: Gets the set of locations that the SKU is available. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets the set of locations that the SKU is available. + * + * @param locations the locations value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @return the locationInfo value. + */ + public List locationInfo() { + return this.locationInfo; + } + + /** + * Set the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @param locationInfo the locationInfo value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withLocationInfo(List locationInfo) { + this.locationInfo = locationInfo; + return this; + } + + /** + * Get the restrictions property: Gets the restrictions because of which SKU cannot be used. This is empty if there + * are no restrictions. + * + * @return the restrictions value. + */ + public List restrictions() { + return this.restrictions; + } + + /** + * Set the restrictions property: Gets the restrictions because of which SKU cannot be used. This is empty if there + * are no restrictions. + * + * @param restrictions the restrictions value to set. + * @return the ResourceSkuInner object itself. + */ + public ResourceSkuInner withRestrictions(List restrictions) { + this.restrictions = restrictions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capacity() != null) { + capacity().validate(); + } + if (locationInfo() != null) { + locationInfo().forEach(e -> e.validate()); + } + if (restrictions() != null) { + restrictions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceUploadDefinitionInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceUploadDefinitionInner.java new file mode 100644 index 0000000000000..73543c745f45c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceUploadDefinitionInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource upload definition payload. */ +@Fluent +public final class ResourceUploadDefinitionInner { + /* + * Source relative path + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * Upload URL + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** Creates an instance of ResourceUploadDefinitionInner class. */ + public ResourceUploadDefinitionInner() { + } + + /** + * Get the relativePath property: Source relative path. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Source relative path. + * + * @param relativePath the relativePath value to set. + * @return the ResourceUploadDefinitionInner object itself. + */ + public ResourceUploadDefinitionInner withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the uploadUrl property: Upload URL. + * + * @return the uploadUrl value. + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the uploadUrl property: Upload URL. + * + * @param uploadUrl the uploadUrl value to set. + * @return the ResourceUploadDefinitionInner object itself. + */ + public ResourceUploadDefinitionInner withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceRegistryResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceRegistryResourceInner.java new file mode 100644 index 0000000000000..e5bccd52dbb14 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceRegistryResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistryProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Service Registry resource. */ +@Fluent +public final class ServiceRegistryResourceInner extends ProxyResource { + /* + * Service Registry properties payload + */ + @JsonProperty(value = "properties") + private ServiceRegistryProperties properties; + + /* + * 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 ServiceRegistryResourceInner class. */ + public ServiceRegistryResourceInner() { + } + + /** + * Get the properties property: Service Registry properties payload. + * + * @return the properties value. + */ + public ServiceRegistryProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Service Registry properties payload. + * + * @param properties the properties value to set. + * @return the ServiceRegistryResourceInner object itself. + */ + public ServiceRegistryResourceInner withProperties(ServiceRegistryProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceResourceInner.java new file mode 100644 index 0000000000000..86c29bfd8c579 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceResourceInner.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Service resource. */ +@Fluent +public final class ServiceResourceInner extends Resource { + /* + * Properties of the Service resource + */ + @JsonProperty(value = "properties") + private ClusterResourceProperties properties; + + /* + * Sku of the Service 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 ServiceResourceInner class. */ + public ServiceResourceInner() { + } + + /** + * Get the properties property: Properties of the Service resource. + * + * @return the properties value. + */ + public ClusterResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the Service resource. + * + * @param properties the properties value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner withProperties(ClusterResourceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the sku property: Sku of the Service resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the Service resource. + * + * @param sku the sku value to set. + * @return the ServiceResourceInner object itself. + */ + public ServiceResourceInner 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 ServiceResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ServiceResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/StorageResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/StorageResourceInner.java new file mode 100644 index 0000000000000..0b51b345c80c4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/StorageResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.StorageProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage resource payload. */ +@Fluent +public final class StorageResourceInner extends ProxyResource { + /* + * Properties of the storage resource payload. + */ + @JsonProperty(value = "properties") + private StorageProperties properties; + + /* + * 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 StorageResourceInner class. */ + public StorageResourceInner() { + } + + /** + * Get the properties property: Properties of the storage resource payload. + * + * @return the properties value. + */ + public StorageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the storage resource payload. + * + * @param properties the properties value to set. + * @return the StorageResourceInner object itself. + */ + public StorageResourceInner withProperties(StorageProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedApmTypeInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedApmTypeInner.java new file mode 100644 index 0000000000000..e7a8429ae40f6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedApmTypeInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported APM type. */ +@Fluent +public final class SupportedApmTypeInner { + /* + * The name of the supported APM type + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of SupportedApmTypeInner class. */ + public SupportedApmTypeInner() { + } + + /** + * Get the name property: The name of the supported APM type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the supported APM type. + * + * @param name the name value to set. + * @return the SupportedApmTypeInner object itself. + */ + public SupportedApmTypeInner withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedBuildpackResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedBuildpackResourceInner.java new file mode 100644 index 0000000000000..754af54e91f4b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedBuildpackResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpackResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported buildpack resource payload. */ +@Fluent +public final class SupportedBuildpackResourceInner extends ProxyResource { + /* + * Supported buildpack resource properties + */ + @JsonProperty(value = "properties") + private SupportedBuildpackResourceProperties properties; + + /* + * 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 SupportedBuildpackResourceInner class. */ + public SupportedBuildpackResourceInner() { + } + + /** + * Get the properties property: Supported buildpack resource properties. + * + * @return the properties value. + */ + public SupportedBuildpackResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Supported buildpack resource properties. + * + * @param properties the properties value to set. + * @return the SupportedBuildpackResourceInner object itself. + */ + public SupportedBuildpackResourceInner withProperties(SupportedBuildpackResourceProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedBuildpacksCollectionInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedBuildpacksCollectionInner.java new file mode 100644 index 0000000000000..ca53ac6c88f82 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedBuildpacksCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of supported buildpacks resources and a possible link for next set. */ +@Fluent +public final class SupportedBuildpacksCollectionInner { + /* + * Collection of supported buildpacks resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SupportedBuildpacksCollectionInner class. */ + public SupportedBuildpacksCollectionInner() { + } + + /** + * Get the value property: Collection of supported buildpacks resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of supported buildpacks resources. + * + * @param value the value value to set. + * @return the SupportedBuildpacksCollectionInner object itself. + */ + public SupportedBuildpacksCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SupportedBuildpacksCollectionInner object itself. + */ + public SupportedBuildpacksCollectionInner 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedServerVersionInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedServerVersionInner.java new file mode 100644 index 0000000000000..cee2517ec60c5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedServerVersionInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported server version. */ +@Fluent +public final class SupportedServerVersionInner { + /* + * The raw server version value which could be passed to deployment CRUD operations. + */ + @JsonProperty(value = "value") + private String value; + + /* + * The server name. + */ + @JsonProperty(value = "server") + private String server; + + /* + * The Server version. + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of SupportedServerVersionInner class. */ + public SupportedServerVersionInner() { + } + + /** + * Get the value property: The raw server version value which could be passed to deployment CRUD operations. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The raw server version value which could be passed to deployment CRUD operations. + * + * @param value the value value to set. + * @return the SupportedServerVersionInner object itself. + */ + public SupportedServerVersionInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the server property: The server name. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The server name. + * + * @param server the server value to set. + * @return the SupportedServerVersionInner object itself. + */ + public SupportedServerVersionInner withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the version property: The Server version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The Server version. + * + * @param version the version value to set. + * @return the SupportedServerVersionInner object itself. + */ + public SupportedServerVersionInner 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedStackResourceInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedStackResourceInner.java new file mode 100644 index 0000000000000..6ce569aa2d49d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedStackResourceInner.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStackResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported stack resource payload. */ +@Fluent +public final class SupportedStackResourceInner extends ProxyResource { + /* + * Supported stack resource properties + */ + @JsonProperty(value = "properties") + private SupportedStackResourceProperties properties; + + /* + * 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 SupportedStackResourceInner class. */ + public SupportedStackResourceInner() { + } + + /** + * Get the properties property: Supported stack resource properties. + * + * @return the properties value. + */ + public SupportedStackResourceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Supported stack resource properties. + * + * @param properties the properties value to set. + * @return the SupportedStackResourceInner object itself. + */ + public SupportedStackResourceInner withProperties(SupportedStackResourceProperties properties) { + this.properties = properties; + 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedStacksCollectionInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedStacksCollectionInner.java new file mode 100644 index 0000000000000..9d7e51010a71c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/SupportedStacksCollectionInner.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of supported stacks resources and a possible link for next set. */ +@Fluent +public final class SupportedStacksCollectionInner { + /* + * Collection of supported stacks resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SupportedStacksCollectionInner class. */ + public SupportedStacksCollectionInner() { + } + + /** + * Get the value property: Collection of supported stacks resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of supported stacks resources. + * + * @param value the value value to set. + * @return the SupportedStacksCollectionInner object itself. + */ + public SupportedStacksCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SupportedStacksCollectionInner object itself. + */ + public SupportedStacksCollectionInner 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/TestKeysInner.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/TestKeysInner.java new file mode 100644 index 0000000000000..1ab066e32f26a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/TestKeysInner.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.appplatform.generated.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test keys payload. */ +@Fluent +public final class TestKeysInner { + /* + * Primary key + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * Secondary key + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /* + * Primary test endpoint + */ + @JsonProperty(value = "primaryTestEndpoint") + private String primaryTestEndpoint; + + /* + * Secondary test endpoint + */ + @JsonProperty(value = "secondaryTestEndpoint") + private String secondaryTestEndpoint; + + /* + * Indicates whether the test endpoint feature enabled or not + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** Creates an instance of TestKeysInner class. */ + public TestKeysInner() { + } + + /** + * Get the primaryKey property: Primary key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: Primary key. + * + * @param primaryKey the primaryKey value to set. + * @return the TestKeysInner object itself. + */ + public TestKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: Secondary key. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: Secondary key. + * + * @param secondaryKey the secondaryKey value to set. + * @return the TestKeysInner object itself. + */ + public TestKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the primaryTestEndpoint property: Primary test endpoint. + * + * @return the primaryTestEndpoint value. + */ + public String primaryTestEndpoint() { + return this.primaryTestEndpoint; + } + + /** + * Set the primaryTestEndpoint property: Primary test endpoint. + * + * @param primaryTestEndpoint the primaryTestEndpoint value to set. + * @return the TestKeysInner object itself. + */ + public TestKeysInner withPrimaryTestEndpoint(String primaryTestEndpoint) { + this.primaryTestEndpoint = primaryTestEndpoint; + return this; + } + + /** + * Get the secondaryTestEndpoint property: Secondary test endpoint. + * + * @return the secondaryTestEndpoint value. + */ + public String secondaryTestEndpoint() { + return this.secondaryTestEndpoint; + } + + /** + * Set the secondaryTestEndpoint property: Secondary test endpoint. + * + * @param secondaryTestEndpoint the secondaryTestEndpoint value to set. + * @return the TestKeysInner object itself. + */ + public TestKeysInner withSecondaryTestEndpoint(String secondaryTestEndpoint) { + this.secondaryTestEndpoint = secondaryTestEndpoint; + return this; + } + + /** + * Get the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @param enabled the enabled value to set. + * @return the TestKeysInner object itself. + */ + public TestKeysInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/package-info.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/package-info.java new file mode 100644 index 0000000000000..60267cd02a8e2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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 AppPlatformManagementClient. REST API for Azure Spring Apps. */ +package com.azure.resourcemanager.appplatform.generated.fluent.models; diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/package-info.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/package-info.java new file mode 100644 index 0000000000000..2c3edad5acf72 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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 AppPlatformManagementClient. REST API for Azure Spring Apps. */ +package com.azure.resourcemanager.appplatform.generated.fluent; diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainResourceImpl.java new file mode 100644 index 0000000000000..f2e75b33d226d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainResourceImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainProperties; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainResource; + +public final class ApiPortalCustomDomainResourceImpl + implements ApiPortalCustomDomainResource, + ApiPortalCustomDomainResource.Definition, + ApiPortalCustomDomainResource.Update { + private ApiPortalCustomDomainResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ApiPortalCustomDomainProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApiPortalCustomDomainResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiPortalName; + + private String domainName; + + public ApiPortalCustomDomainResourceImpl withExistingApiPortal( + String resourceGroupName, String serviceName, String apiPortalName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.apiPortalName = apiPortalName; + return this; + } + + public ApiPortalCustomDomainResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortalCustomDomains() + .createOrUpdate( + resourceGroupName, serviceName, apiPortalName, domainName, this.innerModel(), Context.NONE); + return this; + } + + public ApiPortalCustomDomainResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortalCustomDomains() + .createOrUpdate(resourceGroupName, serviceName, apiPortalName, domainName, this.innerModel(), context); + return this; + } + + ApiPortalCustomDomainResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ApiPortalCustomDomainResourceInner(); + this.serviceManager = serviceManager; + this.domainName = name; + } + + public ApiPortalCustomDomainResourceImpl update() { + return this; + } + + public ApiPortalCustomDomainResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortalCustomDomains() + .createOrUpdate( + resourceGroupName, serviceName, apiPortalName, domainName, this.innerModel(), Context.NONE); + return this; + } + + public ApiPortalCustomDomainResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortalCustomDomains() + .createOrUpdate(resourceGroupName, serviceName, apiPortalName, domainName, this.innerModel(), context); + return this; + } + + ApiPortalCustomDomainResourceImpl( + ApiPortalCustomDomainResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.apiPortalName = Utils.getValueFromIdByName(innerObject.id(), "apiPortals"); + this.domainName = Utils.getValueFromIdByName(innerObject.id(), "domains"); + } + + public ApiPortalCustomDomainResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortalCustomDomains() + .getWithResponse(resourceGroupName, serviceName, apiPortalName, domainName, Context.NONE) + .getValue(); + return this; + } + + public ApiPortalCustomDomainResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortalCustomDomains() + .getWithResponse(resourceGroupName, serviceName, apiPortalName, domainName, context) + .getValue(); + return this; + } + + public ApiPortalCustomDomainResourceImpl withProperties(ApiPortalCustomDomainProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsClientImpl.java new file mode 100644 index 0000000000000..70e22cc895d12 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsClientImpl.java @@ -0,0 +1,1272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.ApiPortalCustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainResourceCollection; +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 ApiPortalCustomDomainsClient. */ +public final class ApiPortalCustomDomainsClientImpl implements ApiPortalCustomDomainsClient { + /** The proxy service used to perform REST calls. */ + private final ApiPortalCustomDomainsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ApiPortalCustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiPortalCustomDomainsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(ApiPortalCustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApiPortalCustomDomains to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ApiPortalCustomDomainsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @PathParam("domainName") String domainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @PathParam("domainName") String domainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apiPortalName, String domainName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + domainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + domainName, + accept, + context); + } + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String apiPortalName, String domainName) { + return getWithResponseAsync(resourceGroupName, serviceName, apiPortalName, domainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiPortalName, domainName, context).block(); + } + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiPortalCustomDomainResourceInner get( + String resourceGroupName, String serviceName, String apiPortalName, String domainName) { + return getWithResponse(resourceGroupName, serviceName, apiPortalName, domainName, Context.NONE).getValue(); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (apiPortalCustomDomainResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter apiPortalCustomDomainResource is required and cannot be null.")); + } else { + apiPortalCustomDomainResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (apiPortalCustomDomainResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter apiPortalCustomDomainResource is required and cannot be null.")); + } else { + apiPortalCustomDomainResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + domainName, + apiPortalCustomDomainResource, + accept, + context); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiPortalCustomDomainResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiPortalCustomDomainResourceInner.class, + ApiPortalCustomDomainResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiPortalCustomDomainResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiPortalCustomDomainResourceInner.class, + ApiPortalCustomDomainResourceInner.class, + context); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource) + .getSyncPoller(); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, context) + .getSyncPoller(); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiPortalCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource) { + return createOrUpdateAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource) + .block(); + } + + /** + * Create or update the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param apiPortalCustomDomainResource The API portal custom domain for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the API portal. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiPortalCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, context) + .block(); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, String domainName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + domainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + domainName, + accept, + context); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, String domainName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, apiPortalName, domainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, String domainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, apiPortalName, domainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, String domainName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, apiPortalName, domainName).getSyncPoller(); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, String domainName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, serviceName, apiPortalName, domainName, context) + .getSyncPoller(); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String apiPortalName, String domainName) { + return beginDeleteAsync(resourceGroupName, serviceName, apiPortalName, domainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String apiPortalName, String domainName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, apiPortalName, domainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiPortalName, String domainName) { + deleteAsync(resourceGroupName, serviceName, apiPortalName, domainName).block(); + } + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiPortalName, String domainName, Context context) { + deleteAsync(resourceGroupName, serviceName, apiPortalName, domainName, context).block(); + } + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String apiPortalName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + 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())); + } + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String apiPortalName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String apiPortalName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, apiPortalName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String apiPortalName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, apiPortalName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, apiPortalName)); + } + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, apiPortalName, 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 object that includes an array of API portal custom domain resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of API portal custom domain resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsImpl.java new file mode 100644 index 0000000000000..a567551872fe3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ApiPortalCustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainResource; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomains; + +public final class ApiPortalCustomDomainsImpl implements ApiPortalCustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(ApiPortalCustomDomainsImpl.class); + + private final ApiPortalCustomDomainsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ApiPortalCustomDomainsImpl( + ApiPortalCustomDomainsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiPortalName, domainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiPortalCustomDomainResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiPortalCustomDomainResource get( + String resourceGroupName, String serviceName, String apiPortalName, String domainName) { + ApiPortalCustomDomainResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, apiPortalName, domainName); + if (inner != null) { + return new ApiPortalCustomDomainResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiPortalName, String domainName) { + this.serviceClient().delete(resourceGroupName, serviceName, apiPortalName, domainName); + } + + public void delete( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, apiPortalName, domainName, context); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, apiPortalName); + return Utils.mapPage(inner, inner1 -> new ApiPortalCustomDomainResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, apiPortalName, context); + return Utils.mapPage(inner, inner1 -> new ApiPortalCustomDomainResourceImpl(inner1, this.manager())); + } + + public ApiPortalCustomDomainResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiPortalName, domainName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiPortalName, domainName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + this.delete(resourceGroupName, serviceName, apiPortalName, domainName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + this.delete(resourceGroupName, serviceName, apiPortalName, domainName, context); + } + + private ApiPortalCustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ApiPortalCustomDomainResourceImpl define(String name) { + return new ApiPortalCustomDomainResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalResourceImpl.java new file mode 100644 index 0000000000000..404ee4b373a3b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalResourceImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalResource; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +public final class ApiPortalResourceImpl + implements ApiPortalResource, ApiPortalResource.Definition, ApiPortalResource.Update { + private ApiPortalResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ApiPortalProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApiPortalResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apiPortalName; + + public ApiPortalResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ApiPortalResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortals() + .createOrUpdate(resourceGroupName, serviceName, apiPortalName, this.innerModel(), Context.NONE); + return this; + } + + public ApiPortalResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortals() + .createOrUpdate(resourceGroupName, serviceName, apiPortalName, this.innerModel(), context); + return this; + } + + ApiPortalResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ApiPortalResourceInner(); + this.serviceManager = serviceManager; + this.apiPortalName = name; + } + + public ApiPortalResourceImpl update() { + return this; + } + + public ApiPortalResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortals() + .createOrUpdate(resourceGroupName, serviceName, apiPortalName, this.innerModel(), Context.NONE); + return this; + } + + public ApiPortalResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortals() + .createOrUpdate(resourceGroupName, serviceName, apiPortalName, this.innerModel(), context); + return this; + } + + ApiPortalResourceImpl( + ApiPortalResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.apiPortalName = Utils.getValueFromIdByName(innerObject.id(), "apiPortals"); + } + + public ApiPortalResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortals() + .getWithResponse(resourceGroupName, serviceName, apiPortalName, Context.NONE) + .getValue(); + return this; + } + + public ApiPortalResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApiPortals() + .getWithResponse(resourceGroupName, serviceName, apiPortalName, context) + .getValue(); + return this; + } + + public Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context) { + return serviceManager + .apiPortals() + .validateDomainWithResponse(resourceGroupName, serviceName, apiPortalName, validatePayload, context); + } + + public CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload) { + return serviceManager + .apiPortals() + .validateDomain(resourceGroupName, serviceName, apiPortalName, validatePayload); + } + + public ApiPortalResourceImpl withProperties(ApiPortalProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ApiPortalResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsClientImpl.java new file mode 100644 index 0000000000000..22da57d5d127d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsClientImpl.java @@ -0,0 +1,1367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.ApiPortalsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +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 ApiPortalsClient. */ +public final class ApiPortalsClientImpl implements ApiPortalsClient { + /** The proxy service used to perform REST calls. */ + private final ApiPortalsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ApiPortalsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApiPortalsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(ApiPortalsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApiPortals to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ApiPortalsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @BodyParam("application/json") ApiPortalResourceInner apiPortalResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateDomain( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apiPortalName") String apiPortalName, + @BodyParam("application/json") CustomDomainValidatePayload validatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apiPortalName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apiPortalName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + accept, + context); + } + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String apiPortalName) { + return getWithResponseAsync(resourceGroupName, serviceName, apiPortalName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apiPortalName, context).block(); + } + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiPortalResourceInner get(String resourceGroupName, String serviceName, String apiPortalName) { + return getWithResponse(resourceGroupName, serviceName, apiPortalName, Context.NONE).getValue(); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (apiPortalResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter apiPortalResource is required and cannot be null.")); + } else { + apiPortalResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (apiPortalResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter apiPortalResource is required and cannot be null.")); + } else { + apiPortalResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + apiPortalResource, + accept, + context); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiPortalResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiPortalResourceInner.class, + ApiPortalResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApiPortalResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApiPortalResourceInner.class, + ApiPortalResourceInner.class, + context); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource) + .getSyncPoller(); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource, context) + .getSyncPoller(); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiPortalResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource).block(); + } + + /** + * Create the default API portal or update the existing API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param apiPortalResource The API portal for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApiPortalResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, apiPortalName, apiPortalResource, context).block(); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + accept, + context); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, apiPortalName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, apiPortalName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, apiPortalName).getSyncPoller(); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apiPortalName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, apiPortalName, context).getSyncPoller(); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String apiPortalName) { + return beginDeleteAsync(resourceGroupName, serviceName, apiPortalName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String apiPortalName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, apiPortalName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiPortalName) { + deleteAsync(resourceGroupName, serviceName, apiPortalName).block(); + } + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apiPortalName, Context context) { + deleteAsync(resourceGroupName, serviceName, apiPortalName, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateDomainWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (validatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter validatePayload is required and cannot be null.")); + } else { + validatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateDomain( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + validatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateDomainWithResponseAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apiPortalName == null) { + return Mono.error(new IllegalArgumentException("Parameter apiPortalName is required and cannot be null.")); + } + if (validatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter validatePayload is required and cannot be null.")); + } else { + validatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateDomain( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apiPortalName, + validatePayload, + accept, + context); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateDomainAsync( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload) { + return validateDomainWithResponseAsync(resourceGroupName, serviceName, apiPortalName, validatePayload) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload, + Context context) { + return validateDomainWithResponseAsync(resourceGroupName, serviceName, apiPortalName, validatePayload, context) + .block(); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validateDomain( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload) { + return validateDomainWithResponse(resourceGroupName, serviceName, apiPortalName, validatePayload, 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 object that includes an array of API portal resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of API portal resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsImpl.java new file mode 100644 index 0000000000000..ac7ae16fbf1ce --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ApiPortalsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalResource; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortals; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; + +public final class ApiPortalsImpl implements ApiPortals { + private static final ClientLogger LOGGER = new ClientLogger(ApiPortalsImpl.class); + + private final ApiPortalsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ApiPortalsImpl( + ApiPortalsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiPortalName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApiPortalResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApiPortalResource get(String resourceGroupName, String serviceName, String apiPortalName) { + ApiPortalResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiPortalName); + if (inner != null) { + return new ApiPortalResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apiPortalName) { + this.serviceClient().delete(resourceGroupName, serviceName, apiPortalName); + } + + public void delete(String resourceGroupName, String serviceName, String apiPortalName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, apiPortalName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApiPortalResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ApiPortalResourceImpl(inner1, this.manager())); + } + + public Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload, + Context context) { + Response inner = + this + .serviceClient() + .validateDomainWithResponse(resourceGroupName, serviceName, apiPortalName, validatePayload, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomDomainValidateResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomDomainValidateResult validateDomain( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload) { + CustomDomainValidateResultInner inner = + this.serviceClient().validateDomain(resourceGroupName, serviceName, apiPortalName, validatePayload); + if (inner != null) { + return new CustomDomainValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApiPortalResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiPortalName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apiPortalName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + this.delete(resourceGroupName, serviceName, apiPortalName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apiPortalName = Utils.getValueFromIdByName(id, "apiPortals"); + if (apiPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apiPortals'.", id))); + } + this.delete(resourceGroupName, serviceName, apiPortalName, context); + } + + private ApiPortalsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ApiPortalResourceImpl define(String name) { + return new ApiPortalResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmResourceImpl.java new file mode 100644 index 0000000000000..a42bcb08b8dfa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmResourceImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmProperties; +import com.azure.resourcemanager.appplatform.generated.models.ApmResource; +import com.azure.resourcemanager.appplatform.generated.models.ApmSecretKeys; + +public final class ApmResourceImpl implements ApmResource, ApmResource.Definition, ApmResource.Update { + private ApmResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ApmProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApmResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String apmName; + + public ApmResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ApmResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApms() + .createOrUpdate(resourceGroupName, serviceName, apmName, this.innerModel(), Context.NONE); + return this; + } + + public ApmResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApms() + .createOrUpdate(resourceGroupName, serviceName, apmName, this.innerModel(), context); + return this; + } + + ApmResourceImpl(String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ApmResourceInner(); + this.serviceManager = serviceManager; + this.apmName = name; + } + + public ApmResourceImpl update() { + return this; + } + + public ApmResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApms() + .createOrUpdate(resourceGroupName, serviceName, apmName, this.innerModel(), Context.NONE); + return this; + } + + public ApmResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApms() + .createOrUpdate(resourceGroupName, serviceName, apmName, this.innerModel(), context); + return this; + } + + ApmResourceImpl( + ApmResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.apmName = Utils.getValueFromIdByName(innerObject.id(), "apms"); + } + + public ApmResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApms() + .getWithResponse(resourceGroupName, serviceName, apmName, Context.NONE) + .getValue(); + return this; + } + + public ApmResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApms() + .getWithResponse(resourceGroupName, serviceName, apmName, context) + .getValue(); + return this; + } + + public Response listSecretKeysWithResponse(Context context) { + return serviceManager.apms().listSecretKeysWithResponse(resourceGroupName, serviceName, apmName, context); + } + + public ApmSecretKeys listSecretKeys() { + return serviceManager.apms().listSecretKeys(resourceGroupName, serviceName, apmName); + } + + public ApmResourceImpl withProperties(ApmProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmSecretKeysImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmSecretKeysImpl.java new file mode 100644 index 0000000000000..40dacb4668ff6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmSecretKeysImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmSecretKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmSecretKeys; +import java.util.Collections; +import java.util.List; + +public final class ApmSecretKeysImpl implements ApmSecretKeys { + private ApmSecretKeysInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ApmSecretKeysImpl( + ApmSecretKeysInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 ApmSecretKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmsClientImpl.java new file mode 100644 index 0000000000000..15ec9844c50d9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmsClientImpl.java @@ -0,0 +1,1288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.ApmsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmSecretKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmResourceCollection; +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 ApmsClient. */ +public final class ApmsClientImpl implements ApmsClient { + /** The proxy service used to perform REST calls. */ + private final ApmsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ApmsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApmsClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(ApmsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApms to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ApmsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apmName") String apmName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apmName") String apmName, + @BodyParam("application/json") ApmResourceInner apmResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apmName") String apmName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSecretKeys( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("apmName") String apmName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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 collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apmName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String apmName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + accept, + context); + } + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String apmName) { + return getWithResponseAsync(resourceGroupName, serviceName, apmName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, apmName, context).block(); + } + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApmResourceInner get(String resourceGroupName, String serviceName, String apmName) { + return getWithResponse(resourceGroupName, serviceName, apmName, Context.NONE).getValue(); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + if (apmResource == null) { + return Mono.error(new IllegalArgumentException("Parameter apmResource is required and cannot be null.")); + } else { + apmResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + apmResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + if (apmResource == null) { + return Mono.error(new IllegalArgumentException("Parameter apmResource is required and cannot be null.")); + } else { + apmResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + apmResource, + accept, + context); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApmResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apmName, apmResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApmResourceInner.class, + ApmResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApmResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, apmName, apmResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ApmResourceInner.class, ApmResourceInner.class, context); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApmResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, serviceName, apmName, apmResource).getSyncPoller(); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApmResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, apmName, apmResource, context) + .getSyncPoller(); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apmName, apmResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, apmName, apmResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApmResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, apmName, apmResource).block(); + } + + /** + * Create or update an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param apmResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPM Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApmResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String apmName, ApmResourceInner apmResource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, apmName, apmResource, context).block(); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apmName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apmName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + accept, + context); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apmName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, apmName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apmName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, apmName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apmName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, apmName).getSyncPoller(); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String apmName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, apmName, context).getSyncPoller(); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String apmName) { + return beginDeleteAsync(resourceGroupName, serviceName, apmName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String apmName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, apmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apmName) { + deleteAsync(resourceGroupName, serviceName, apmName).block(); + } + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String apmName, Context context) { + deleteAsync(resourceGroupName, serviceName, apmName, context).block(); + } + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretKeysWithResponseAsync( + String resourceGroupName, String serviceName, String apmName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecretKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretKeysWithResponseAsync( + String resourceGroupName, String serviceName, String apmName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apmName == null) { + return Mono.error(new IllegalArgumentException("Parameter apmName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecretKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apmName, + accept, + context); + } + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretKeysAsync(String resourceGroupName, String serviceName, String apmName) { + return listSecretKeysWithResponseAsync(resourceGroupName, serviceName, apmName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretKeysWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context) { + return listSecretKeysWithResponseAsync(resourceGroupName, serviceName, apmName, context).block(); + } + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApmSecretKeysInner listSecretKeys(String resourceGroupName, String serviceName, String apmName) { + return listSecretKeysWithResponse(resourceGroupName, serviceName, apmName, 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 object that includes an array of APM resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of APM resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmsImpl.java new file mode 100644 index 0000000000000..c596eb7962a12 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApmsImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ApmsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmSecretKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmResource; +import com.azure.resourcemanager.appplatform.generated.models.ApmSecretKeys; +import com.azure.resourcemanager.appplatform.generated.models.Apms; + +public final class ApmsImpl implements Apms { + private static final ClientLogger LOGGER = new ClientLogger(ApmsImpl.class); + + private final ApmsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ApmsImpl( + ApmsClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApmResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ApmResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, apmName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApmResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApmResource get(String resourceGroupName, String serviceName, String apmName) { + ApmResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, apmName); + if (inner != null) { + return new ApmResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String apmName) { + this.serviceClient().delete(resourceGroupName, serviceName, apmName); + } + + public void delete(String resourceGroupName, String serviceName, String apmName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, apmName, context); + } + + public Response listSecretKeysWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context) { + Response inner = + this.serviceClient().listSecretKeysWithResponse(resourceGroupName, serviceName, apmName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApmSecretKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApmSecretKeys listSecretKeys(String resourceGroupName, String serviceName, String apmName) { + ApmSecretKeysInner inner = this.serviceClient().listSecretKeys(resourceGroupName, serviceName, apmName); + if (inner != null) { + return new ApmSecretKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public ApmResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apmName = Utils.getValueFromIdByName(id, "apms"); + if (apmName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apms'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apmName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apmName = Utils.getValueFromIdByName(id, "apms"); + if (apmName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apms'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, apmName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apmName = Utils.getValueFromIdByName(id, "apms"); + if (apmName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apms'.", id))); + } + this.delete(resourceGroupName, serviceName, apmName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String apmName = Utils.getValueFromIdByName(id, "apms"); + if (apmName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apms'.", id))); + } + this.delete(resourceGroupName, serviceName, apmName, context); + } + + private ApmsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ApmResourceImpl define(String name) { + return new ApmResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientBuilder.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientBuilder.java new file mode 100644 index 0000000000000..a287c01c8d347 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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 AppPlatformManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {AppPlatformManagementClientImpl.class}) +public final class AppPlatformManagementClientBuilder { + /* + * Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder 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 AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder 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 AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder 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 AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder 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 AppPlatformManagementClientBuilder. + */ + public AppPlatformManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of AppPlatformManagementClientImpl with the provided parameters. + * + * @return an instance of AppPlatformManagementClientImpl. + */ + public AppPlatformManagementClientImpl 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(); + AppPlatformManagementClientImpl client = + new AppPlatformManagementClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + this.subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientImpl.java new file mode 100644 index 0000000000000..7dffc26a5b1da --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientImpl.java @@ -0,0 +1,715 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ApiPortalCustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ApiPortalsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ApmsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.AppPlatformManagementClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ApplicationAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ApplicationLiveViewsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.BindingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.BuildServiceAgentPoolsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.BuildServiceBuildersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.BuildServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.BuildpackBindingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.CertificatesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ConfigServersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ConfigurationServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ContainerRegistriesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.CustomizedAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.DevToolPortalsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.EurekaServersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.GatewayCustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.GatewayRouteConfigsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.GatewaysClient; +import com.azure.resourcemanager.appplatform.generated.fluent.MonitoringSettingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.OperationsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.PredefinedAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.RuntimeVersionsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ServiceRegistriesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.SkusClient; +import com.azure.resourcemanager.appplatform.generated.fluent.StoragesClient; +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 AppPlatformManagementClientImpl type. */ +@ServiceClient(builder = AppPlatformManagementClientBuilder.class) +public final class AppPlatformManagementClientImpl implements AppPlatformManagementClient { + /** + * Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @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 ServicesClient object to access its operations. */ + private final ServicesClient services; + + /** + * Gets the ServicesClient object to access its operations. + * + * @return the ServicesClient object. + */ + public ServicesClient getServices() { + return this.services; + } + + /** The ApmsClient object to access its operations. */ + private final ApmsClient apms; + + /** + * Gets the ApmsClient object to access its operations. + * + * @return the ApmsClient object. + */ + public ApmsClient getApms() { + return this.apms; + } + + /** The EurekaServersClient object to access its operations. */ + private final EurekaServersClient eurekaServers; + + /** + * Gets the EurekaServersClient object to access its operations. + * + * @return the EurekaServersClient object. + */ + public EurekaServersClient getEurekaServers() { + return this.eurekaServers; + } + + /** The ConfigServersClient object to access its operations. */ + private final ConfigServersClient configServers; + + /** + * Gets the ConfigServersClient object to access its operations. + * + * @return the ConfigServersClient object. + */ + public ConfigServersClient getConfigServers() { + return this.configServers; + } + + /** The ConfigurationServicesClient object to access its operations. */ + private final ConfigurationServicesClient configurationServices; + + /** + * Gets the ConfigurationServicesClient object to access its operations. + * + * @return the ConfigurationServicesClient object. + */ + public ConfigurationServicesClient getConfigurationServices() { + return this.configurationServices; + } + + /** The ServiceRegistriesClient object to access its operations. */ + private final ServiceRegistriesClient serviceRegistries; + + /** + * Gets the ServiceRegistriesClient object to access its operations. + * + * @return the ServiceRegistriesClient object. + */ + public ServiceRegistriesClient getServiceRegistries() { + return this.serviceRegistries; + } + + /** The ApplicationLiveViewsClient object to access its operations. */ + private final ApplicationLiveViewsClient applicationLiveViews; + + /** + * Gets the ApplicationLiveViewsClient object to access its operations. + * + * @return the ApplicationLiveViewsClient object. + */ + public ApplicationLiveViewsClient getApplicationLiveViews() { + return this.applicationLiveViews; + } + + /** The DevToolPortalsClient object to access its operations. */ + private final DevToolPortalsClient devToolPortals; + + /** + * Gets the DevToolPortalsClient object to access its operations. + * + * @return the DevToolPortalsClient object. + */ + public DevToolPortalsClient getDevToolPortals() { + return this.devToolPortals; + } + + /** The ContainerRegistriesClient object to access its operations. */ + private final ContainerRegistriesClient containerRegistries; + + /** + * Gets the ContainerRegistriesClient object to access its operations. + * + * @return the ContainerRegistriesClient object. + */ + public ContainerRegistriesClient getContainerRegistries() { + return this.containerRegistries; + } + + /** The BuildServicesClient object to access its operations. */ + private final BuildServicesClient buildServices; + + /** + * Gets the BuildServicesClient object to access its operations. + * + * @return the BuildServicesClient object. + */ + public BuildServicesClient getBuildServices() { + return this.buildServices; + } + + /** The BuildpackBindingsClient object to access its operations. */ + private final BuildpackBindingsClient buildpackBindings; + + /** + * Gets the BuildpackBindingsClient object to access its operations. + * + * @return the BuildpackBindingsClient object. + */ + public BuildpackBindingsClient getBuildpackBindings() { + return this.buildpackBindings; + } + + /** The BuildServiceBuildersClient object to access its operations. */ + private final BuildServiceBuildersClient buildServiceBuilders; + + /** + * Gets the BuildServiceBuildersClient object to access its operations. + * + * @return the BuildServiceBuildersClient object. + */ + public BuildServiceBuildersClient getBuildServiceBuilders() { + return this.buildServiceBuilders; + } + + /** The BuildServiceAgentPoolsClient object to access its operations. */ + private final BuildServiceAgentPoolsClient buildServiceAgentPools; + + /** + * Gets the BuildServiceAgentPoolsClient object to access its operations. + * + * @return the BuildServiceAgentPoolsClient object. + */ + public BuildServiceAgentPoolsClient getBuildServiceAgentPools() { + return this.buildServiceAgentPools; + } + + /** The MonitoringSettingsClient object to access its operations. */ + private final MonitoringSettingsClient monitoringSettings; + + /** + * Gets the MonitoringSettingsClient object to access its operations. + * + * @return the MonitoringSettingsClient object. + */ + public MonitoringSettingsClient getMonitoringSettings() { + return this.monitoringSettings; + } + + /** The AppsClient object to access its operations. */ + private final AppsClient apps; + + /** + * Gets the AppsClient object to access its operations. + * + * @return the AppsClient object. + */ + public AppsClient getApps() { + return this.apps; + } + + /** The BindingsClient object to access its operations. */ + private final BindingsClient bindings; + + /** + * Gets the BindingsClient object to access its operations. + * + * @return the BindingsClient object. + */ + public BindingsClient getBindings() { + return this.bindings; + } + + /** The StoragesClient object to access its operations. */ + private final StoragesClient storages; + + /** + * Gets the StoragesClient object to access its operations. + * + * @return the StoragesClient object. + */ + public StoragesClient getStorages() { + return this.storages; + } + + /** The CertificatesClient object to access its operations. */ + private final CertificatesClient certificates; + + /** + * Gets the CertificatesClient object to access its operations. + * + * @return the CertificatesClient object. + */ + public CertificatesClient getCertificates() { + return this.certificates; + } + + /** The CustomDomainsClient object to access its operations. */ + private final CustomDomainsClient customDomains; + + /** + * Gets the CustomDomainsClient object to access its operations. + * + * @return the CustomDomainsClient object. + */ + public CustomDomainsClient getCustomDomains() { + return this.customDomains; + } + + /** The DeploymentsClient object to access its operations. */ + private final DeploymentsClient deployments; + + /** + * Gets the DeploymentsClient object to access its operations. + * + * @return the DeploymentsClient object. + */ + public DeploymentsClient getDeployments() { + return this.deployments; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The RuntimeVersionsClient object to access its operations. */ + private final RuntimeVersionsClient runtimeVersions; + + /** + * Gets the RuntimeVersionsClient object to access its operations. + * + * @return the RuntimeVersionsClient object. + */ + public RuntimeVersionsClient getRuntimeVersions() { + return this.runtimeVersions; + } + + /** The SkusClient object to access its operations. */ + private final SkusClient skus; + + /** + * Gets the SkusClient object to access its operations. + * + * @return the SkusClient object. + */ + public SkusClient getSkus() { + return this.skus; + } + + /** The GatewaysClient object to access its operations. */ + private final GatewaysClient gateways; + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + public GatewaysClient getGateways() { + return this.gateways; + } + + /** The GatewayRouteConfigsClient object to access its operations. */ + private final GatewayRouteConfigsClient gatewayRouteConfigs; + + /** + * Gets the GatewayRouteConfigsClient object to access its operations. + * + * @return the GatewayRouteConfigsClient object. + */ + public GatewayRouteConfigsClient getGatewayRouteConfigs() { + return this.gatewayRouteConfigs; + } + + /** The GatewayCustomDomainsClient object to access its operations. */ + private final GatewayCustomDomainsClient gatewayCustomDomains; + + /** + * Gets the GatewayCustomDomainsClient object to access its operations. + * + * @return the GatewayCustomDomainsClient object. + */ + public GatewayCustomDomainsClient getGatewayCustomDomains() { + return this.gatewayCustomDomains; + } + + /** The ApiPortalsClient object to access its operations. */ + private final ApiPortalsClient apiPortals; + + /** + * Gets the ApiPortalsClient object to access its operations. + * + * @return the ApiPortalsClient object. + */ + public ApiPortalsClient getApiPortals() { + return this.apiPortals; + } + + /** The ApiPortalCustomDomainsClient object to access its operations. */ + private final ApiPortalCustomDomainsClient apiPortalCustomDomains; + + /** + * Gets the ApiPortalCustomDomainsClient object to access its operations. + * + * @return the ApiPortalCustomDomainsClient object. + */ + public ApiPortalCustomDomainsClient getApiPortalCustomDomains() { + return this.apiPortalCustomDomains; + } + + /** The ApplicationAcceleratorsClient object to access its operations. */ + private final ApplicationAcceleratorsClient applicationAccelerators; + + /** + * Gets the ApplicationAcceleratorsClient object to access its operations. + * + * @return the ApplicationAcceleratorsClient object. + */ + public ApplicationAcceleratorsClient getApplicationAccelerators() { + return this.applicationAccelerators; + } + + /** The CustomizedAcceleratorsClient object to access its operations. */ + private final CustomizedAcceleratorsClient customizedAccelerators; + + /** + * Gets the CustomizedAcceleratorsClient object to access its operations. + * + * @return the CustomizedAcceleratorsClient object. + */ + public CustomizedAcceleratorsClient getCustomizedAccelerators() { + return this.customizedAccelerators; + } + + /** The PredefinedAcceleratorsClient object to access its operations. */ + private final PredefinedAcceleratorsClient predefinedAccelerators; + + /** + * Gets the PredefinedAcceleratorsClient object to access its operations. + * + * @return the PredefinedAcceleratorsClient object. + */ + public PredefinedAcceleratorsClient getPredefinedAccelerators() { + return this.predefinedAccelerators; + } + + /** + * Initializes an instance of AppPlatformManagementClient 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 Gets subscription ID which uniquely identify the Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + AppPlatformManagementClientImpl( + 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 = "2023-11-01-preview"; + this.services = new ServicesClientImpl(this); + this.apms = new ApmsClientImpl(this); + this.eurekaServers = new EurekaServersClientImpl(this); + this.configServers = new ConfigServersClientImpl(this); + this.configurationServices = new ConfigurationServicesClientImpl(this); + this.serviceRegistries = new ServiceRegistriesClientImpl(this); + this.applicationLiveViews = new ApplicationLiveViewsClientImpl(this); + this.devToolPortals = new DevToolPortalsClientImpl(this); + this.containerRegistries = new ContainerRegistriesClientImpl(this); + this.buildServices = new BuildServicesClientImpl(this); + this.buildpackBindings = new BuildpackBindingsClientImpl(this); + this.buildServiceBuilders = new BuildServiceBuildersClientImpl(this); + this.buildServiceAgentPools = new BuildServiceAgentPoolsClientImpl(this); + this.monitoringSettings = new MonitoringSettingsClientImpl(this); + this.apps = new AppsClientImpl(this); + this.bindings = new BindingsClientImpl(this); + this.storages = new StoragesClientImpl(this); + this.certificates = new CertificatesClientImpl(this); + this.customDomains = new CustomDomainsClientImpl(this); + this.deployments = new DeploymentsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.runtimeVersions = new RuntimeVersionsClientImpl(this); + this.skus = new SkusClientImpl(this); + this.gateways = new GatewaysClientImpl(this); + this.gatewayRouteConfigs = new GatewayRouteConfigsClientImpl(this); + this.gatewayCustomDomains = new GatewayCustomDomainsClientImpl(this); + this.apiPortals = new ApiPortalsClientImpl(this); + this.apiPortalCustomDomains = new ApiPortalCustomDomainsClientImpl(this); + this.applicationAccelerators = new ApplicationAcceleratorsClientImpl(this); + this.customizedAccelerators = new CustomizedAcceleratorsClientImpl(this); + this.predefinedAccelerators = new PredefinedAcceleratorsClientImpl(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(AppPlatformManagementClientImpl.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppResourceImpl.java new file mode 100644 index 0000000000000..6b09b17d9ec10 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppResourceImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.AppResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ActiveDeploymentCollection; +import com.azure.resourcemanager.appplatform.generated.models.AppResource; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.generated.models.ResourceUploadDefinition; + +public final class AppResourceImpl implements AppResource, AppResource.Definition, AppResource.Update { + private AppResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AppResourceProperties properties() { + return this.innerModel().properties(); + } + + public ManagedIdentityProperties identity() { + return this.innerModel().identity(); + } + + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AppResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String appName; + + public AppResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public AppResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApps() + .createOrUpdate(resourceGroupName, serviceName, appName, this.innerModel(), Context.NONE); + return this; + } + + public AppResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApps() + .createOrUpdate(resourceGroupName, serviceName, appName, this.innerModel(), context); + return this; + } + + AppResourceImpl(String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new AppResourceInner(); + this.serviceManager = serviceManager; + this.appName = name; + } + + public AppResourceImpl update() { + return this; + } + + public AppResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApps() + .update(resourceGroupName, serviceName, appName, this.innerModel(), Context.NONE); + return this; + } + + public AppResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApps() + .update(resourceGroupName, serviceName, appName, this.innerModel(), context); + return this; + } + + AppResourceImpl( + AppResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.appName = Utils.getValueFromIdByName(innerObject.id(), "apps"); + } + + public AppResource refresh() { + String localSyncStatus = null; + this.innerObject = + serviceManager + .serviceClient() + .getApps() + .getWithResponse(resourceGroupName, serviceName, appName, localSyncStatus, Context.NONE) + .getValue(); + return this; + } + + public AppResource refresh(Context context) { + String localSyncStatus = null; + this.innerObject = + serviceManager + .serviceClient() + .getApps() + .getWithResponse(resourceGroupName, serviceName, appName, localSyncStatus, context) + .getValue(); + return this; + } + + public Response getResourceUploadUrlWithResponse(Context context) { + return serviceManager.apps().getResourceUploadUrlWithResponse(resourceGroupName, serviceName, appName, context); + } + + public ResourceUploadDefinition getResourceUploadUrl() { + return serviceManager.apps().getResourceUploadUrl(resourceGroupName, serviceName, appName); + } + + public AppResource setActiveDeployments(ActiveDeploymentCollection activeDeploymentCollection) { + return serviceManager + .apps() + .setActiveDeployments(resourceGroupName, serviceName, appName, activeDeploymentCollection); + } + + public AppResource setActiveDeployments(ActiveDeploymentCollection activeDeploymentCollection, Context context) { + return serviceManager + .apps() + .setActiveDeployments(resourceGroupName, serviceName, appName, activeDeploymentCollection, context); + } + + public Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context) { + return serviceManager + .apps() + .validateDomainWithResponse(resourceGroupName, serviceName, appName, validatePayload, context); + } + + public CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload) { + return serviceManager.apps().validateDomain(resourceGroupName, serviceName, appName, validatePayload); + } + + public AppResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AppResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AppResourceImpl withProperties(AppResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public AppResourceImpl withIdentity(ManagedIdentityProperties identity) { + this.innerModel().withIdentity(identity); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorResourceImpl.java new file mode 100644 index 0000000000000..260d3e60e3354 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorResourceImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +public final class ApplicationAcceleratorResourceImpl + implements ApplicationAcceleratorResource, + ApplicationAcceleratorResource.Definition, + ApplicationAcceleratorResource.Update { + private ApplicationAcceleratorResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ApplicationAcceleratorProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApplicationAcceleratorResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String applicationAcceleratorName; + + public ApplicationAcceleratorResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ApplicationAcceleratorResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationAccelerators() + .createOrUpdate( + resourceGroupName, serviceName, applicationAcceleratorName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationAcceleratorResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationAccelerators() + .createOrUpdate(resourceGroupName, serviceName, applicationAcceleratorName, this.innerModel(), context); + return this; + } + + ApplicationAcceleratorResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ApplicationAcceleratorResourceInner(); + this.serviceManager = serviceManager; + this.applicationAcceleratorName = name; + } + + public ApplicationAcceleratorResourceImpl update() { + return this; + } + + public ApplicationAcceleratorResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationAccelerators() + .createOrUpdate( + resourceGroupName, serviceName, applicationAcceleratorName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationAcceleratorResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationAccelerators() + .createOrUpdate(resourceGroupName, serviceName, applicationAcceleratorName, this.innerModel(), context); + return this; + } + + ApplicationAcceleratorResourceImpl( + ApplicationAcceleratorResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.applicationAcceleratorName = Utils.getValueFromIdByName(innerObject.id(), "applicationAccelerators"); + } + + public ApplicationAcceleratorResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationAccelerators() + .getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationAcceleratorResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationAccelerators() + .getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, context) + .getValue(); + return this; + } + + public ApplicationAcceleratorResourceImpl withProperties(ApplicationAcceleratorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ApplicationAcceleratorResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorsClientImpl.java new file mode 100644 index 0000000000000..ea8d0be97ae16 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorsClientImpl.java @@ -0,0 +1,1209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.ApplicationAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorResourceCollection; +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 ApplicationAcceleratorsClient. */ +public final class ApplicationAcceleratorsClientImpl implements ApplicationAcceleratorsClient { + /** The proxy service used to perform REST calls. */ + private final ApplicationAcceleratorsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ApplicationAcceleratorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationAcceleratorsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(ApplicationAcceleratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApplicationAccelerators to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ApplicationAcceleratorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @BodyParam("application/json") ApplicationAcceleratorResourceInner applicationAcceleratorResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + accept, + context); + } + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + return getWithResponseAsync(resourceGroupName, serviceName, applicationAcceleratorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, applicationAcceleratorName, context).block(); + } + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationAcceleratorResourceInner get( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + return getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, Context.NONE).getValue(); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (applicationAcceleratorResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorResource is required and cannot be null.")); + } else { + applicationAcceleratorResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + applicationAcceleratorResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (applicationAcceleratorResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorResource is required and cannot be null.")); + } else { + applicationAcceleratorResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + applicationAcceleratorResource, + accept, + context); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationAcceleratorResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationAcceleratorResourceInner.class, + ApplicationAcceleratorResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationAcceleratorResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationAcceleratorResourceInner.class, + ApplicationAcceleratorResourceInner.class, + context); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationAcceleratorResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource) + .getSyncPoller(); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationAcceleratorResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, context) + .getSyncPoller(); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource) { + return createOrUpdateAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource) + .block(); + } + + /** + * Create or update the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param applicationAcceleratorResource The application accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + ApplicationAcceleratorResourceInner applicationAcceleratorResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, context) + .block(); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationAcceleratorName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + accept, + context); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationAcceleratorName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, applicationAcceleratorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationAcceleratorName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, applicationAcceleratorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationAcceleratorName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, applicationAcceleratorName).getSyncPoller(); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationAcceleratorName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, context) + .getSyncPoller(); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String applicationAcceleratorName) { + return beginDeleteAsync(resourceGroupName, serviceName, applicationAcceleratorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String applicationAcceleratorName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String applicationAcceleratorName) { + deleteAsync(resourceGroupName, serviceName, applicationAcceleratorName).block(); + } + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String applicationAcceleratorName, Context context) { + deleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of application accelerator resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorsImpl.java new file mode 100644 index 0000000000000..c3000420055c5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationAcceleratorsImpl.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ApplicationAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorResource; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAccelerators; + +public final class ApplicationAcceleratorsImpl implements ApplicationAccelerators { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationAcceleratorsImpl.class); + + private final ApplicationAcceleratorsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ApplicationAcceleratorsImpl( + ApplicationAcceleratorsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApplicationAcceleratorResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationAcceleratorResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationAcceleratorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationAcceleratorResource get( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + ApplicationAcceleratorResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, applicationAcceleratorName); + if (inner != null) { + return new ApplicationAcceleratorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String applicationAcceleratorName) { + this.serviceClient().delete(resourceGroupName, serviceName, applicationAcceleratorName); + } + + public void delete( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, applicationAcceleratorName, context); + } + + public ApplicationAcceleratorResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + return this + .getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, applicationAcceleratorName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + this.delete(resourceGroupName, serviceName, applicationAcceleratorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + this.delete(resourceGroupName, serviceName, applicationAcceleratorName, context); + } + + private ApplicationAcceleratorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ApplicationAcceleratorResourceImpl define(String name) { + return new ApplicationAcceleratorResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewResourceImpl.java new file mode 100644 index 0000000000000..917422bcd33ad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewResourceImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewProperties; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewResource; + +public final class ApplicationLiveViewResourceImpl + implements ApplicationLiveViewResource, ApplicationLiveViewResource.Definition, ApplicationLiveViewResource.Update { + private ApplicationLiveViewResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ApplicationLiveViewProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ApplicationLiveViewResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String applicationLiveViewName; + + public ApplicationLiveViewResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ApplicationLiveViewResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationLiveViews() + .createOrUpdate( + resourceGroupName, serviceName, applicationLiveViewName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationLiveViewResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationLiveViews() + .createOrUpdate(resourceGroupName, serviceName, applicationLiveViewName, this.innerModel(), context); + return this; + } + + ApplicationLiveViewResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ApplicationLiveViewResourceInner(); + this.serviceManager = serviceManager; + this.applicationLiveViewName = name; + } + + public ApplicationLiveViewResourceImpl update() { + return this; + } + + public ApplicationLiveViewResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationLiveViews() + .createOrUpdate( + resourceGroupName, serviceName, applicationLiveViewName, this.innerModel(), Context.NONE); + return this; + } + + public ApplicationLiveViewResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationLiveViews() + .createOrUpdate(resourceGroupName, serviceName, applicationLiveViewName, this.innerModel(), context); + return this; + } + + ApplicationLiveViewResourceImpl( + ApplicationLiveViewResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.applicationLiveViewName = Utils.getValueFromIdByName(innerObject.id(), "applicationLiveViews"); + } + + public ApplicationLiveViewResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationLiveViews() + .getWithResponse(resourceGroupName, serviceName, applicationLiveViewName, Context.NONE) + .getValue(); + return this; + } + + public ApplicationLiveViewResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getApplicationLiveViews() + .getWithResponse(resourceGroupName, serviceName, applicationLiveViewName, context) + .getValue(); + return this; + } + + public ApplicationLiveViewResourceImpl withProperties(ApplicationLiveViewProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewsClientImpl.java new file mode 100644 index 0000000000000..6190ea6137b56 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewsClientImpl.java @@ -0,0 +1,1201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.ApplicationLiveViewsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewResourceCollection; +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 ApplicationLiveViewsClient. */ +public final class ApplicationLiveViewsClientImpl implements ApplicationLiveViewsClient { + /** The proxy service used to perform REST calls. */ + private final ApplicationLiveViewsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ApplicationLiveViewsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ApplicationLiveViewsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(ApplicationLiveViewsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApplicationLiveViews to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ApplicationLiveViewsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationLiveViewName") String applicationLiveViewName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationLiveViewName") String applicationLiveViewName, + @BodyParam("application/json") ApplicationLiveViewResourceInner applicationLiveViewResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationLiveViewName") String applicationLiveViewName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String applicationLiveViewName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationLiveViewName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationLiveViewName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationLiveViewName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String applicationLiveViewName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationLiveViewName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationLiveViewName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationLiveViewName, + accept, + context); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String applicationLiveViewName) { + return getWithResponseAsync(resourceGroupName, serviceName, applicationLiveViewName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String applicationLiveViewName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, applicationLiveViewName, context).block(); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationLiveViewResourceInner get( + String resourceGroupName, String serviceName, String applicationLiveViewName) { + return getWithResponse(resourceGroupName, serviceName, applicationLiveViewName, Context.NONE).getValue(); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationLiveViewName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationLiveViewName is required and cannot be null.")); + } + if (applicationLiveViewResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationLiveViewResource is required and cannot be null.")); + } else { + applicationLiveViewResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationLiveViewName, + applicationLiveViewResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationLiveViewName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationLiveViewName is required and cannot be null.")); + } + if (applicationLiveViewResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationLiveViewResource is required and cannot be null.")); + } else { + applicationLiveViewResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationLiveViewName, + applicationLiveViewResource, + accept, + context); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 application Live View resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationLiveViewResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationLiveViewResourceInner.class, + ApplicationLiveViewResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of application Live View resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ApplicationLiveViewResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ApplicationLiveViewResourceInner.class, + ApplicationLiveViewResourceInner.class, + context); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 application Live View resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationLiveViewResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource) + .getSyncPoller(); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of application Live View resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApplicationLiveViewResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, context) + .getSyncPoller(); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationLiveViewResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource) + .block(); + } + + /** + * Create the default Application Live View or update the existing Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param applicationLiveViewResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Live View resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ApplicationLiveViewResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationLiveViewName, + ApplicationLiveViewResourceInner applicationLiveViewResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, context) + .block(); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationLiveViewName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationLiveViewName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationLiveViewName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationLiveViewName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationLiveViewName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationLiveViewName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationLiveViewName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationLiveViewName, + accept, + context); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationLiveViewName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, applicationLiveViewName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationLiveViewName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, applicationLiveViewName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationLiveViewName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, applicationLiveViewName).getSyncPoller(); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String applicationLiveViewName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, applicationLiveViewName, context).getSyncPoller(); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String applicationLiveViewName) { + return beginDeleteAsync(resourceGroupName, serviceName, applicationLiveViewName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String applicationLiveViewName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, applicationLiveViewName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String applicationLiveViewName) { + deleteAsync(resourceGroupName, serviceName, applicationLiveViewName).block(); + } + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String applicationLiveViewName, Context context) { + deleteAsync(resourceGroupName, serviceName, applicationLiveViewName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Application Live View resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewsImpl.java new file mode 100644 index 0000000000000..e90d3262d6f6b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApplicationLiveViewsImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ApplicationLiveViewsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewResource; +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViews; + +public final class ApplicationLiveViewsImpl implements ApplicationLiveViews { + private static final ClientLogger LOGGER = new ClientLogger(ApplicationLiveViewsImpl.class); + + private final ApplicationLiveViewsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ApplicationLiveViewsImpl( + ApplicationLiveViewsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ApplicationLiveViewResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ApplicationLiveViewResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String applicationLiveViewName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, applicationLiveViewName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ApplicationLiveViewResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ApplicationLiveViewResource get( + String resourceGroupName, String serviceName, String applicationLiveViewName) { + ApplicationLiveViewResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, applicationLiveViewName); + if (inner != null) { + return new ApplicationLiveViewResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String applicationLiveViewName) { + this.serviceClient().delete(resourceGroupName, serviceName, applicationLiveViewName); + } + + public void delete(String resourceGroupName, String serviceName, String applicationLiveViewName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, applicationLiveViewName, context); + } + + public ApplicationLiveViewResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationLiveViewName = Utils.getValueFromIdByName(id, "applicationLiveViews"); + if (applicationLiveViewName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationLiveViews'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, applicationLiveViewName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationLiveViewName = Utils.getValueFromIdByName(id, "applicationLiveViews"); + if (applicationLiveViewName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationLiveViews'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, applicationLiveViewName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationLiveViewName = Utils.getValueFromIdByName(id, "applicationLiveViews"); + if (applicationLiveViewName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationLiveViews'.", + id))); + } + this.delete(resourceGroupName, serviceName, applicationLiveViewName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationLiveViewName = Utils.getValueFromIdByName(id, "applicationLiveViews"); + if (applicationLiveViewName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationLiveViews'.", + id))); + } + this.delete(resourceGroupName, serviceName, applicationLiveViewName, context); + } + + private ApplicationLiveViewsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ApplicationLiveViewResourceImpl define(String name) { + return new ApplicationLiveViewResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsClientImpl.java new file mode 100644 index 0000000000000..66ccd3c13cac6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsClientImpl.java @@ -0,0 +1,2189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AppResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.models.ActiveDeploymentCollection; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +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 AppsClient. */ +public final class AppsClientImpl implements AppsClient { + /** The proxy service used to perform REST calls. */ + private final AppsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of AppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AppsClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(AppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientApps to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface AppsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @QueryParam("syncStatus") String syncStatus, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") AppResourceInner appResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") AppResourceInner appResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getResourceUploadUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/setActiveDeployments") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> setActiveDeployments( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") ActiveDeploymentCollection activeDeploymentCollection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateDomain( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @BodyParam("application/json") CustomDomainValidatePayload validatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + syncStatus, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + syncStatus, + accept, + context); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String appName) { + final String syncStatus = null; + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus, context).block(); + } + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner get(String resourceGroupName, String serviceName, String appName) { + final String syncStatus = null; + return getWithResponse(resourceGroupName, serviceName, appName, syncStatus, Context.NONE).getValue(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + accept, + context); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AppResourceInner.class, + AppResourceInner.class, + this.client.getContext()); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, context); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).getSyncPoller(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .getSyncPoller(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, appResource).block(); + } + + /** + * Create a new App or update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, appName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName).getSyncPoller(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, context).getSyncPoller(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String appName) { + return beginDeleteAsync(resourceGroupName, serviceName, appName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String appName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName) { + deleteAsync(resourceGroupName, serviceName, appName).block(); + } + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, context).block(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (appResource == null) { + return Mono.error(new IllegalArgumentException("Parameter appResource is required and cannot be null.")); + } else { + appResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + appResource, + accept, + context); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AppResourceInner.class, + AppResourceInner.class, + this.client.getContext()); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, appResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, context); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return this.beginUpdateAsync(resourceGroupName, serviceName, appName, appResource).getSyncPoller(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return this.beginUpdateAsync(resourceGroupName, serviceName, appName, appResource, context).getSyncPoller(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, appResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return updateAsync(resourceGroupName, serviceName, appName, appResource).block(); + } + + /** + * Operation to update an exiting App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param appResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner update( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return updateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getResourceUploadUrlAsync( + String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, appName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String appName, Context context) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, appName, context).block(); + } + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceUploadDefinitionInner getResourceUploadUrl( + String resourceGroupName, String serviceName, String appName) { + return getResourceUploadUrlWithResponse(resourceGroupName, serviceName, appName, Context.NONE).getValue(); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setActiveDeploymentsWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (activeDeploymentCollection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDeploymentCollection is required and cannot be null.")); + } else { + activeDeploymentCollection.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .setActiveDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> setActiveDeploymentsWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (activeDeploymentCollection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter activeDeploymentCollection is required and cannot be null.")); + } else { + activeDeploymentCollection.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .setActiveDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + activeDeploymentCollection, + accept, + context); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppResourceInner> beginSetActiveDeploymentsAsync( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + Mono>> mono = + setActiveDeploymentsWithResponseAsync(resourceGroupName, serviceName, appName, activeDeploymentCollection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + AppResourceInner.class, + AppResourceInner.class, + this.client.getContext()); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AppResourceInner> beginSetActiveDeploymentsAsync( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + setActiveDeploymentsWithResponseAsync( + resourceGroupName, serviceName, appName, activeDeploymentCollection, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), AppResourceInner.class, AppResourceInner.class, context); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginSetActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + return this + .beginSetActiveDeploymentsAsync(resourceGroupName, serviceName, appName, activeDeploymentCollection) + .getSyncPoller(); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 app resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginSetActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context) { + return this + .beginSetActiveDeploymentsAsync( + resourceGroupName, serviceName, appName, activeDeploymentCollection, context) + .getSyncPoller(); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setActiveDeploymentsAsync( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + return beginSetActiveDeploymentsAsync(resourceGroupName, serviceName, appName, activeDeploymentCollection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono setActiveDeploymentsAsync( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context) { + return beginSetActiveDeploymentsAsync( + resourceGroupName, serviceName, appName, activeDeploymentCollection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + return setActiveDeploymentsAsync(resourceGroupName, serviceName, appName, activeDeploymentCollection).block(); + } + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AppResourceInner setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context) { + return setActiveDeploymentsAsync(resourceGroupName, serviceName, appName, activeDeploymentCollection, context) + .block(); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateDomainWithResponseAsync( + String resourceGroupName, String serviceName, String appName, CustomDomainValidatePayload validatePayload) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (validatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter validatePayload is required and cannot be null.")); + } else { + validatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateDomain( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + validatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateDomainWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + CustomDomainValidatePayload validatePayload, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (validatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter validatePayload is required and cannot be null.")); + } else { + validatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateDomain( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + validatePayload, + accept, + context); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateDomainAsync( + String resourceGroupName, String serviceName, String appName, CustomDomainValidatePayload validatePayload) { + return validateDomainWithResponseAsync(resourceGroupName, serviceName, appName, validatePayload) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String appName, + CustomDomainValidatePayload validatePayload, + Context context) { + return validateDomainWithResponseAsync(resourceGroupName, serviceName, appName, validatePayload, context) + .block(); + } + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validateDomain( + String resourceGroupName, String serviceName, String appName, CustomDomainValidatePayload validatePayload) { + return validateDomainWithResponse(resourceGroupName, serviceName, appName, validatePayload, 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 object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsImpl.java new file mode 100644 index 0000000000000..54943050735f8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.AppsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AppResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.models.ActiveDeploymentCollection; +import com.azure.resourcemanager.appplatform.generated.models.AppResource; +import com.azure.resourcemanager.appplatform.generated.models.Apps; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.ResourceUploadDefinition; + +public final class AppsImpl implements Apps { + private static final ClientLogger LOGGER = new ClientLogger(AppsImpl.class); + + private final AppsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public AppsImpl( + AppsClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, appName, syncStatus, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AppResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AppResource get(String resourceGroupName, String serviceName, String appName) { + AppResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, appName); + if (inner != null) { + return new AppResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String appName) { + this.serviceClient().delete(resourceGroupName, serviceName, appName); + } + + public void delete(String resourceGroupName, String serviceName, String appName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new AppResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new AppResourceImpl(inner1, this.manager())); + } + + public Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String appName, Context context) { + Response inner = + this.serviceClient().getResourceUploadUrlWithResponse(resourceGroupName, serviceName, appName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceUploadDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ResourceUploadDefinition getResourceUploadUrl(String resourceGroupName, String serviceName, String appName) { + ResourceUploadDefinitionInner inner = + this.serviceClient().getResourceUploadUrl(resourceGroupName, serviceName, appName); + if (inner != null) { + return new ResourceUploadDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public AppResource setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + AppResourceInner inner = + this + .serviceClient() + .setActiveDeployments(resourceGroupName, serviceName, appName, activeDeploymentCollection); + if (inner != null) { + return new AppResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public AppResource setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context) { + AppResourceInner inner = + this + .serviceClient() + .setActiveDeployments(resourceGroupName, serviceName, appName, activeDeploymentCollection, context); + if (inner != null) { + return new AppResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String appName, + CustomDomainValidatePayload validatePayload, + Context context) { + Response inner = + this + .serviceClient() + .validateDomainWithResponse(resourceGroupName, serviceName, appName, validatePayload, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomDomainValidateResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomDomainValidateResult validateDomain( + String resourceGroupName, String serviceName, String appName, CustomDomainValidatePayload validatePayload) { + CustomDomainValidateResultInner inner = + this.serviceClient().validateDomain(resourceGroupName, serviceName, appName, validatePayload); + if (inner != null) { + return new CustomDomainValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public AppResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String localSyncStatus = null; + return this.getWithResponse(resourceGroupName, serviceName, appName, localSyncStatus, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, String syncStatus, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, syncStatus, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, context); + } + + private AppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public AppResourceImpl define(String name) { + return new AppResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AvailableRuntimeVersionsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AvailableRuntimeVersionsImpl.java new file mode 100644 index 0000000000000..b8f994d533f94 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AvailableRuntimeVersionsImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.AvailableRuntimeVersionsInner; +import com.azure.resourcemanager.appplatform.generated.models.AvailableRuntimeVersions; +import com.azure.resourcemanager.appplatform.generated.models.SupportedRuntimeVersion; +import java.util.Collections; +import java.util.List; + +public final class AvailableRuntimeVersionsImpl implements AvailableRuntimeVersions { + private AvailableRuntimeVersionsInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + AvailableRuntimeVersionsImpl( + AvailableRuntimeVersionsInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 AvailableRuntimeVersionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingResourceImpl.java new file mode 100644 index 0000000000000..4ad757ea4a253 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingResourceImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BindingResource; +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; + +public final class BindingResourceImpl implements BindingResource, BindingResource.Definition, BindingResource.Update { + private BindingResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BindingResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BindingResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String appName; + + private String bindingName; + + public BindingResourceImpl withExistingApp(String resourceGroupName, String serviceName, String appName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.appName = appName; + return this; + } + + public BindingResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getBindings() + .createOrUpdate(resourceGroupName, serviceName, appName, bindingName, this.innerModel(), Context.NONE); + return this; + } + + public BindingResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBindings() + .createOrUpdate(resourceGroupName, serviceName, appName, bindingName, this.innerModel(), context); + return this; + } + + BindingResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new BindingResourceInner(); + this.serviceManager = serviceManager; + this.bindingName = name; + } + + public BindingResourceImpl update() { + return this; + } + + public BindingResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBindings() + .update(resourceGroupName, serviceName, appName, bindingName, this.innerModel(), Context.NONE); + return this; + } + + public BindingResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBindings() + .update(resourceGroupName, serviceName, appName, bindingName, this.innerModel(), context); + return this; + } + + BindingResourceImpl( + BindingResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.appName = Utils.getValueFromIdByName(innerObject.id(), "apps"); + this.bindingName = Utils.getValueFromIdByName(innerObject.id(), "bindings"); + } + + public BindingResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBindings() + .getWithResponse(resourceGroupName, serviceName, appName, bindingName, Context.NONE) + .getValue(); + return this; + } + + public BindingResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBindings() + .getWithResponse(resourceGroupName, serviceName, appName, bindingName, context) + .getValue(); + return this; + } + + public BindingResourceImpl withProperties(BindingResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsClientImpl.java new file mode 100644 index 0000000000000..320cd2b2682af --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsClientImpl.java @@ -0,0 +1,1625 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.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.appplatform.generated.fluent.BindingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceCollection; +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 BindingsClient. */ +public final class BindingsClientImpl implements BindingsClient { + /** The proxy service used to perform REST calls. */ + private final BindingsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of BindingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BindingsClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(BindingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBindings to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface BindingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @BodyParam("application/json") BindingResourceInner bindingResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("bindingName") String bindingName, + @BodyParam("application/json") BindingResourceInner bindingResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + accept, + context); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, bindingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, context).block(); + } + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner get(String resourceGroupName, String serviceName, String appName, String bindingName) { + return getWithResponse(resourceGroupName, serviceName, appName, bindingName, Context.NONE).getValue(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (bindingResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter bindingResource is required and cannot be null.")); + } else { + bindingResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (bindingResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter bindingResource is required and cannot be null.")); + } else { + bindingResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + accept, + context); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BindingResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BindingResourceInner.class, + BindingResourceInner.class, + this.client.getContext()); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BindingResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, bindingName, bindingResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BindingResourceInner.class, BindingResourceInner.class, context); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource) + .getSyncPoller(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context) + .getSyncPoller(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource).block(); + } + + /** + * Create a new Binding or update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context) + .block(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + accept, + context); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, String bindingName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, bindingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String bindingName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, bindingName).getSyncPoller(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, bindingName, context).getSyncPoller(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String bindingName) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, bindingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, bindingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, String bindingName) { + deleteAsync(resourceGroupName, serviceName, appName, bindingName).block(); + } + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, bindingName, context).block(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (bindingResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter bindingResource is required and cannot be null.")); + } else { + bindingResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (bindingName == null) { + return Mono.error(new IllegalArgumentException("Parameter bindingName is required and cannot be null.")); + } + if (bindingResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter bindingResource is required and cannot be null.")); + } else { + bindingResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + bindingName, + bindingResource, + accept, + context); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BindingResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BindingResourceInner.class, + BindingResourceInner.class, + this.client.getContext()); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BindingResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BindingResourceInner.class, BindingResourceInner.class, context); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return this + .beginUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of binding resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return updateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource).block(); + } + + /** + * Operation to update an exiting Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param bindingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return binding resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BindingResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, bindingName, bindingResource, context).block(); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + 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())); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, 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 object that includes an array of Binding resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Binding resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsImpl.java new file mode 100644 index 0000000000000..798156e27ebd4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.BindingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BindingResource; +import com.azure.resourcemanager.appplatform.generated.models.Bindings; + +public final class BindingsImpl implements Bindings { + private static final ClientLogger LOGGER = new ClientLogger(BindingsImpl.class); + + private final BindingsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public BindingsImpl( + BindingsClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, appName, bindingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BindingResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BindingResource get(String resourceGroupName, String serviceName, String appName, String bindingName) { + BindingResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, appName, bindingName); + if (inner != null) { + return new BindingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String appName, String bindingName) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, bindingName); + } + + public void delete( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, bindingName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, appName); + return Utils.mapPage(inner, inner1 -> new BindingResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, appName, context); + return Utils.mapPage(inner, inner1 -> new BindingResourceImpl(inner1, this.manager())); + } + + public BindingResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String bindingName = Utils.getValueFromIdByName(id, "bindings"); + if (bindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bindings'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, bindingName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String bindingName = Utils.getValueFromIdByName(id, "bindings"); + if (bindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bindings'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, bindingName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String bindingName = Utils.getValueFromIdByName(id, "bindings"); + if (bindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bindings'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, bindingName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String bindingName = Utils.getValueFromIdByName(id, "bindings"); + if (bindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bindings'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, bindingName, context); + } + + private BindingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public BindingResourceImpl define(String name) { + return new BindingResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildImpl.java new file mode 100644 index 0000000000000..52c7dd1bdf942 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner; +import com.azure.resourcemanager.appplatform.generated.models.Build; +import com.azure.resourcemanager.appplatform.generated.models.BuildProperties; + +public final class BuildImpl implements Build, Build.Definition, Build.Update { + private BuildInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BuildProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BuildInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String buildServiceName; + + private String buildName; + + public BuildImpl withExistingBuildService(String resourceGroupName, String serviceName, String buildServiceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.buildServiceName = buildServiceName; + return this; + } + + public Build create() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdateBuildWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Build create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdateBuildWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, this.innerModel(), context) + .getValue(); + return this; + } + + BuildImpl(String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new BuildInner(); + this.serviceManager = serviceManager; + this.buildName = name; + } + + public BuildImpl update() { + return this; + } + + public Build apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdateBuildWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Build apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdateBuildWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, this.innerModel(), context) + .getValue(); + return this; + } + + BuildImpl( + BuildInner innerObject, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.buildServiceName = Utils.getValueFromIdByName(innerObject.id(), "buildServices"); + this.buildName = Utils.getValueFromIdByName(innerObject.id(), "builds"); + } + + public Build refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .getBuildWithResponse(resourceGroupName, serviceName, buildServiceName, buildName, Context.NONE) + .getValue(); + return this; + } + + public Build refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .getBuildWithResponse(resourceGroupName, serviceName, buildServiceName, buildName, context) + .getValue(); + return this; + } + + public BuildImpl withProperties(BuildProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildResultImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildResultImpl.java new file mode 100644 index 0000000000000..d451470feb7bc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildResultImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildResult; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultProperties; + +public final class BuildResultImpl implements BuildResult { + private BuildResultInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + BuildResultImpl( + BuildResultInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 BuildResultProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuildResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildResultLogImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildResultLogImpl.java new file mode 100644 index 0000000000000..ed0bc18a4ecbe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildResultLogImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultLogInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultLog; + +public final class BuildResultLogImpl implements BuildResultLog { + private BuildResultLogInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + BuildResultLogImpl( + BuildResultLogInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String blobUrl() { + return this.innerModel().blobUrl(); + } + + public BuildResultLogInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolResourceImpl.java new file mode 100644 index 0000000000000..a811a92a57e1c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolResource; + +public final class BuildServiceAgentPoolResourceImpl implements BuildServiceAgentPoolResource { + private BuildServiceAgentPoolResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + BuildServiceAgentPoolResourceImpl( + BuildServiceAgentPoolResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 BuildServiceAgentPoolProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuildServiceAgentPoolResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsClientImpl.java new file mode 100644 index 0000000000000..124ad872d6483 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsClientImpl.java @@ -0,0 +1,972 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.BuildServiceAgentPoolsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolResourceCollection; +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 BuildServiceAgentPoolsClient. */ +public final class BuildServiceAgentPoolsClientImpl implements BuildServiceAgentPoolsClient { + /** The proxy service used to perform REST calls. */ + private final BuildServiceAgentPoolsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of BuildServiceAgentPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildServiceAgentPoolsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(BuildServiceAgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBuildServiceAgentPools to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface BuildServiceAgentPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("agentPoolName") String agentPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/agentPools/{agentPoolName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePut( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("agentPoolName") String agentPoolName, + @BodyParam("application/json") BuildServiceAgentPoolResourceInner agentPoolResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, buildServiceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, buildServiceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName)); + } + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName, context)); + } + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + accept, + context); + } + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName) { + return getWithResponseAsync(resourceGroupName, serviceName, buildServiceName, agentPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, buildServiceName, agentPoolName, context).block(); + } + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildServiceAgentPoolResourceInner get( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName) { + return getWithResponse(resourceGroupName, serviceName, buildServiceName, agentPoolName, Context.NONE) + .getValue(); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + if (agentPoolResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentPoolResource is required and cannot be null.")); + } else { + agentPoolResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } + if (agentPoolResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter agentPoolResource is required and cannot be null.")); + } else { + agentPoolResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + agentPoolName, + agentPoolResource, + accept, + context); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildServiceAgentPoolResourceInner> + beginUpdatePutAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + Mono>> mono = + updatePutWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BuildServiceAgentPoolResourceInner.class, + BuildServiceAgentPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildServiceAgentPoolResourceInner> + beginUpdatePutAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePutWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BuildServiceAgentPoolResourceInner.class, + BuildServiceAgentPoolResourceInner.class, + context); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildServiceAgentPoolResourceInner> + beginUpdatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + return this + .beginUpdatePutAsync(resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource) + .getSyncPoller(); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildServiceAgentPoolResourceInner> + beginUpdatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context) { + return this + .beginUpdatePutAsync( + resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, context) + .getSyncPoller(); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + return beginUpdatePutAsync(resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context) { + return beginUpdatePutAsync( + resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildServiceAgentPoolResourceInner updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + return updatePutAsync(resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource) + .block(); + } + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildServiceAgentPoolResourceInner updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context) { + return updatePutAsync( + resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of build service agent pool resources and a possible link for next set + * along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsImpl.java new file mode 100644 index 0000000000000..f490b64517c3c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsImpl.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.appplatform.generated.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.appplatform.generated.fluent.BuildServiceAgentPoolsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolResource; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPools; + +public final class BuildServiceAgentPoolsImpl implements BuildServiceAgentPools { + private static final ClientLogger LOGGER = new ClientLogger(BuildServiceAgentPoolsImpl.class); + + private final BuildServiceAgentPoolsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public BuildServiceAgentPoolsImpl( + BuildServiceAgentPoolsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, buildServiceName); + return Utils.mapPage(inner, inner1 -> new BuildServiceAgentPoolResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, buildServiceName, context); + return Utils.mapPage(inner, inner1 -> new BuildServiceAgentPoolResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, serviceName, buildServiceName, agentPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuildServiceAgentPoolResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildServiceAgentPoolResource get( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName) { + BuildServiceAgentPoolResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, buildServiceName, agentPoolName); + if (inner != null) { + return new BuildServiceAgentPoolResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public BuildServiceAgentPoolResource updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + BuildServiceAgentPoolResourceInner inner = + this + .serviceClient() + .updatePut(resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource); + if (inner != null) { + return new BuildServiceAgentPoolResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public BuildServiceAgentPoolResource updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context) { + BuildServiceAgentPoolResourceInner inner = + this + .serviceClient() + .updatePut(resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, context); + if (inner != null) { + return new BuildServiceAgentPoolResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private BuildServiceAgentPoolsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersClientImpl.java new file mode 100644 index 0000000000000..46335b67fd507 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersClientImpl.java @@ -0,0 +1,1461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.BuildServiceBuildersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentListInner; +import com.azure.resourcemanager.appplatform.generated.models.BuilderResourceCollection; +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 BuildServiceBuildersClient. */ +public final class BuildServiceBuildersClientImpl implements BuildServiceBuildersClient { + /** The proxy service used to perform REST calls. */ + private final BuildServiceBuildersService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of BuildServiceBuildersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildServiceBuildersClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(BuildServiceBuildersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBuildServiceBuilders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface BuildServiceBuildersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @BodyParam("application/json") BuilderResourceInner builderResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDeployments( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context); + } + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return getWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName, context).block(); + } + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner get( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return getWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, Context.NONE).getValue(); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (builderResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter builderResource is required and cannot be null.")); + } else { + builderResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (builderResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter builderResource is required and cannot be null.")); + } else { + builderResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + builderResource, + accept, + context); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuilderResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, builderName, builderResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BuilderResourceInner.class, + BuilderResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuilderResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, builderName, builderResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BuilderResourceInner.class, BuilderResourceInner.class, context); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, builderName, builderResource) + .getSyncPoller(); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, buildServiceName, builderName, builderResource, context) + .getSyncPoller(); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, builderName, builderResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, buildServiceName, builderName, builderResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, builderName, builderResource) + .block(); + } + + /** + * Create or update a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param builderResource The target builder for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return kPack Builder resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuilderResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, buildServiceName, builderName, builderResource, context) + .block(); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, buildServiceName, builderName).getSyncPoller(); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, context) + .getSyncPoller(); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return beginDeleteAsync(resourceGroupName, serviceName, buildServiceName, builderName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + deleteAsync(resourceGroupName, serviceName, buildServiceName, builderName).block(); + } + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + deleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, context).block(); + } + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, buildServiceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, buildServiceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName)); + } + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName, context)); + } + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeploymentsWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listDeploymentsWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listDeployments( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context); + } + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listDeploymentsAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return listDeploymentsWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDeploymentsWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return listDeploymentsWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName, context) + .block(); + } + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentListInner listDeployments( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return listDeploymentsWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, 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 object that includes an array of Builder resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Builder resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersImpl.java new file mode 100644 index 0000000000000..82dd4c42b42c3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.BuildServiceBuildersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentListInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceBuilders; +import com.azure.resourcemanager.appplatform.generated.models.BuilderResource; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentList; + +public final class BuildServiceBuildersImpl implements BuildServiceBuilders { + private static final ClientLogger LOGGER = new ClientLogger(BuildServiceBuildersImpl.class); + + private final BuildServiceBuildersClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public BuildServiceBuildersImpl( + BuildServiceBuildersClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuilderResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuilderResource get( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + BuilderResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, buildServiceName, builderName); + if (inner != null) { + return new BuilderResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + this.serviceClient().delete(resourceGroupName, serviceName, buildServiceName, builderName); + } + + public void delete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, buildServiceName, builderName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName, String buildServiceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, buildServiceName); + return Utils.mapPage(inner, inner1 -> new BuilderResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, buildServiceName, context); + return Utils.mapPage(inner, inner1 -> new BuilderResourceImpl(inner1, this.manager())); + } + + public Response listDeploymentsWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + Response inner = + this + .serviceClient() + .listDeploymentsWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentListImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentList listDeployments( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + DeploymentListInner inner = + this.serviceClient().listDeployments(resourceGroupName, serviceName, buildServiceName, builderName); + if (inner != null) { + return new DeploymentListImpl(inner, this.manager()); + } else { + return null; + } + } + + public BuilderResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + return this + .getWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + this.delete(resourceGroupName, serviceName, buildServiceName, builderName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + this.delete(resourceGroupName, serviceName, buildServiceName, builderName, context); + } + + private BuildServiceBuildersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public BuilderResourceImpl define(String name) { + return new BuilderResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceImpl.java new file mode 100644 index 0000000000000..f56b0dba13753 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceImpl.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.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildService; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ResourceUploadDefinition; + +public final class BuildServiceImpl implements BuildService, BuildService.Definition, BuildService.Update { + private BuildServiceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BuildServiceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BuildServiceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String buildServiceName; + + public BuildServiceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public BuildService create() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdate(resourceGroupName, serviceName, buildServiceName, this.innerModel(), Context.NONE); + return this; + } + + public BuildService create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdate(resourceGroupName, serviceName, buildServiceName, this.innerModel(), context); + return this; + } + + BuildServiceImpl(String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new BuildServiceInner(); + this.serviceManager = serviceManager; + this.buildServiceName = name; + } + + public BuildServiceImpl update() { + return this; + } + + public BuildService apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdate(resourceGroupName, serviceName, buildServiceName, this.innerModel(), Context.NONE); + return this; + } + + public BuildService apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .createOrUpdate(resourceGroupName, serviceName, buildServiceName, this.innerModel(), context); + return this; + } + + BuildServiceImpl( + BuildServiceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.buildServiceName = Utils.getValueFromIdByName(innerObject.id(), "buildServices"); + } + + public BuildService refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .getBuildServiceWithResponse(resourceGroupName, serviceName, buildServiceName, Context.NONE) + .getValue(); + return this; + } + + public BuildService refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServices() + .getBuildServiceWithResponse(resourceGroupName, serviceName, buildServiceName, context) + .getValue(); + return this; + } + + public Response getResourceUploadUrlWithResponse(Context context) { + return serviceManager + .buildServices() + .getResourceUploadUrlWithResponse(resourceGroupName, serviceName, buildServiceName, context); + } + + public ResourceUploadDefinition getResourceUploadUrl() { + return serviceManager.buildServices().getResourceUploadUrl(resourceGroupName, serviceName, buildServiceName); + } + + public BuildServiceImpl withProperties(BuildServiceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesClientImpl.java new file mode 100644 index 0000000000000..e5a540bb2b7a6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesClientImpl.java @@ -0,0 +1,3654 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.BuildServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultLogInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildCollection; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultCollection; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceCollection; +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 BuildServicesClient. */ +public final class BuildServicesClientImpl implements BuildServicesClient { + /** The proxy service used to perform REST calls. */ + private final BuildServicesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of BuildServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildServicesClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(BuildServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBuildServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface BuildServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBuildServices( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildService( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @BodyParam("application/json") BuildServiceInner buildService, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBuilds( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuild( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateBuild( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildName") String buildName, + @BodyParam("application/json") BuildInner build, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteBuild( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBuildResults( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildName") String buildName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildResult( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildName") String buildName, + @PathParam("buildResultName") String buildResultName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}/results/{buildResultName}/getLogFileUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildResultLog( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildName") String buildName, + @PathParam("buildResultName") String buildResultName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/getResourceUploadUrl") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getResourceUploadUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedBuildpacks( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedBuildpacks/{buildpackName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSupportedBuildpack( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("buildpackName") String buildpackName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedStacks( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/supportedStacks/{stackName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSupportedStack( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("stackName") String stackName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBuildServicesNext( + @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> listBuildsNext( + @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> listBuildResultsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildServicesSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBuildServices( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildServicesSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBuildServices( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuildServicesAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listBuildServicesSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listBuildServicesNextSinglePageAsync(nextLink)); + } + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuildServicesAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listBuildServicesSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listBuildServicesNextSinglePageAsync(nextLink, context)); + } + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuildServices(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listBuildServicesAsync(resourceGroupName, serviceName)); + } + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuildServices( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listBuildServicesAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildServiceWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBuildService( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildServiceWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBuildService( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context); + } + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildServiceAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return getBuildServiceWithResponseAsync(resourceGroupName, serviceName, buildServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildServiceWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return getBuildServiceWithResponseAsync(resourceGroupName, serviceName, buildServiceName, context).block(); + } + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildServiceInner getBuildService(String resourceGroupName, String serviceName, String buildServiceName) { + return getBuildServiceWithResponse(resourceGroupName, serviceName, buildServiceName, Context.NONE).getValue(); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildService == null) { + return Mono.error(new IllegalArgumentException("Parameter buildService is required and cannot be null.")); + } else { + buildService.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildService, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildService == null) { + return Mono.error(new IllegalArgumentException("Parameter buildService is required and cannot be null.")); + } else { + buildService.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildService, + accept, + context); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 build service resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildService); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BuildServiceInner.class, + BuildServiceInner.class, + this.client.getContext()); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of build service resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildServiceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildService, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), BuildServiceInner.class, BuildServiceInner.class, context); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 build service resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildServiceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, buildService) + .getSyncPoller(); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of build service resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildServiceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, buildService, context) + .getSyncPoller(); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, buildService) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, buildService, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildServiceInner createOrUpdate( + String resourceGroupName, String serviceName, String buildServiceName, BuildServiceInner buildService) { + return createOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, buildService).block(); + } + + /** + * Create a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildService Parameters for the create operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildServiceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + BuildServiceInner buildService, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, buildServiceName, buildService, context).block(); + } + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildsSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBuilds( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildsSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBuilds( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuildsAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return new PagedFlux<>( + () -> listBuildsSinglePageAsync(resourceGroupName, serviceName, buildServiceName), + nextLink -> listBuildsNextSinglePageAsync(nextLink)); + } + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuildsAsync( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedFlux<>( + () -> listBuildsSinglePageAsync(resourceGroupName, serviceName, buildServiceName, context), + nextLink -> listBuildsNextSinglePageAsync(nextLink, context)); + } + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuilds(String resourceGroupName, String serviceName, String buildServiceName) { + return new PagedIterable<>(listBuildsAsync(resourceGroupName, serviceName, buildServiceName)); + } + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuilds( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedIterable<>(listBuildsAsync(resourceGroupName, serviceName, buildServiceName, context)); + } + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBuild( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBuild( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + accept, + context); + } + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + return getBuildWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + return getBuildWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildName, context).block(); + } + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildInner getBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + return getBuildWithResponse(resourceGroupName, serviceName, buildServiceName, buildName, Context.NONE) + .getValue(); + } + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateBuildWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, BuildInner build) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (build == null) { + return Mono.error(new IllegalArgumentException("Parameter build is required and cannot be null.")); + } else { + build.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdateBuild( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateBuildWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + BuildInner build, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (build == null) { + return Mono.error(new IllegalArgumentException("Parameter build is required and cannot be null.")); + } else { + build.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdateBuild( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + build, + accept, + context); + } + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateBuildAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, BuildInner build) { + return createOrUpdateBuildWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildName, build) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build resource payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateBuildWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + BuildInner build, + Context context) { + return createOrUpdateBuildWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, buildName, build, context) + .block(); + } + + /** + * Create or update a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param build Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildInner createOrUpdateBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, BuildInner build) { + return createOrUpdateBuildWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, build, Context.NONE) + .getValue(); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteBuildWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deleteBuild( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteBuildWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deleteBuild( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + accept, + context); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteBuildAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + Mono>> mono = + deleteBuildWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteBuildAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteBuildWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + return this.beginDeleteBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName).getSyncPoller(); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + return this + .beginDeleteBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName, context) + .getSyncPoller(); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteBuildAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + return beginDeleteBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteBuildAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + return beginDeleteBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + deleteBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName).block(); + } + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + deleteBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName, context).block(); + } + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildResultsSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBuildResults( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildResultsSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBuildResults( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuildResultsAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + return new PagedFlux<>( + () -> listBuildResultsSinglePageAsync(resourceGroupName, serviceName, buildServiceName, buildName), + nextLink -> listBuildResultsNextSinglePageAsync(nextLink)); + } + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBuildResultsAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + return new PagedFlux<>( + () -> listBuildResultsSinglePageAsync(resourceGroupName, serviceName, buildServiceName, buildName, context), + nextLink -> listBuildResultsNextSinglePageAsync(nextLink, context)); + } + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + return new PagedIterable<>(listBuildResultsAsync(resourceGroupName, serviceName, buildServiceName, buildName)); + } + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + return new PagedIterable<>( + listBuildResultsAsync(resourceGroupName, serviceName, buildServiceName, buildName, context)); + } + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildResultWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (buildResultName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildResultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBuildResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildResultWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (buildResultName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildResultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBuildResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName, + accept, + context); + } + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildResultAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + return getBuildResultWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildResultWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context) { + return getBuildResultWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, context) + .block(); + } + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildResultInner getBuildResult( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + return getBuildResultWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, Context.NONE) + .getValue(); + } + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildResultLogWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (buildResultName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildResultName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getBuildResultLog( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getBuildResultLogWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null.")); + } + if (buildResultName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildResultName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getBuildResultLog( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildName, + buildResultName, + accept, + context); + } + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getBuildResultLogAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + return getBuildResultLogWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildResultLogWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context) { + return getBuildResultLogWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, context) + .block(); + } + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildResultLogInner getBuildResultLog( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + return getBuildResultLogWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, Context.NONE) + .getValue(); + } + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive along with {@link + * Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getResourceUploadUrlWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getResourceUploadUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context); + } + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getResourceUploadUrlAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, buildServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return getResourceUploadUrlWithResponseAsync(resourceGroupName, serviceName, buildServiceName, context).block(); + } + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ResourceUploadDefinitionInner getResourceUploadUrl( + String resourceGroupName, String serviceName, String buildServiceName) { + return getResourceUploadUrlWithResponse(resourceGroupName, serviceName, buildServiceName, Context.NONE) + .getValue(); + } + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedBuildpacksWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSupportedBuildpacks( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedBuildpacksWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSupportedBuildpacks( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context); + } + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSupportedBuildpacksAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return listSupportedBuildpacksWithResponseAsync(resourceGroupName, serviceName, buildServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedBuildpacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return listSupportedBuildpacksWithResponseAsync(resourceGroupName, serviceName, buildServiceName, context) + .block(); + } + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedBuildpacksCollectionInner listSupportedBuildpacks( + String resourceGroupName, String serviceName, String buildServiceName) { + return listSupportedBuildpacksWithResponse(resourceGroupName, serviceName, buildServiceName, Context.NONE) + .getValue(); + } + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedBuildpackWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildpackName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildpackName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSupportedBuildpack( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildpackName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedBuildpackWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (buildpackName == null) { + return Mono.error(new IllegalArgumentException("Parameter buildpackName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSupportedBuildpack( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + buildpackName, + accept, + context); + } + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSupportedBuildpackAsync( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName) { + return getSupportedBuildpackWithResponseAsync(resourceGroupName, serviceName, buildServiceName, buildpackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSupportedBuildpackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName, Context context) { + return getSupportedBuildpackWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, buildpackName, context) + .block(); + } + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedBuildpackResourceInner getSupportedBuildpack( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName) { + return getSupportedBuildpackWithResponse( + resourceGroupName, serviceName, buildServiceName, buildpackName, Context.NONE) + .getValue(); + } + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedStacksWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSupportedStacks( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedStacksWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSupportedStacks( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + accept, + context); + } + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSupportedStacksAsync( + String resourceGroupName, String serviceName, String buildServiceName) { + return listSupportedStacksWithResponseAsync(resourceGroupName, serviceName, buildServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSupportedStacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return listSupportedStacksWithResponseAsync(resourceGroupName, serviceName, buildServiceName, context).block(); + } + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedStacksCollectionInner listSupportedStacks( + String resourceGroupName, String serviceName, String buildServiceName) { + return listSupportedStacksWithResponse(resourceGroupName, serviceName, buildServiceName, Context.NONE) + .getValue(); + } + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedStackWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String stackName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (stackName == null) { + return Mono.error(new IllegalArgumentException("Parameter stackName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getSupportedStack( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + stackName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSupportedStackWithResponseAsync( + String resourceGroupName, String serviceName, String buildServiceName, String stackName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (stackName == null) { + return Mono.error(new IllegalArgumentException("Parameter stackName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getSupportedStack( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + stackName, + accept, + context); + } + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSupportedStackAsync( + String resourceGroupName, String serviceName, String buildServiceName, String stackName) { + return getSupportedStackWithResponseAsync(resourceGroupName, serviceName, buildServiceName, stackName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSupportedStackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String stackName, Context context) { + return getSupportedStackWithResponseAsync(resourceGroupName, serviceName, buildServiceName, stackName, context) + .block(); + } + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SupportedStackResourceInner getSupportedStack( + String resourceGroupName, String serviceName, String buildServiceName, String stackName) { + return getSupportedStackWithResponse(resourceGroupName, serviceName, buildServiceName, stackName, 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 object that includes an array of Build service resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildServicesNextSinglePageAsync(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.listBuildServicesNext(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 object that includes an array of Build service resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildServicesNextSinglePageAsync( + 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 + .listBuildServicesNext(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 object that includes an array of Build resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildsNextSinglePageAsync(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.listBuildsNext(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 object that includes an array of Build resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildsNextSinglePageAsync(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 + .listBuildsNext(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 object that includes an array of Build result resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildResultsNextSinglePageAsync(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.listBuildResultsNext(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 object that includes an array of Build result resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBuildResultsNextSinglePageAsync( + 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 + .listBuildResultsNext(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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesImpl.java new file mode 100644 index 0000000000000..939ffc5278e05 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesImpl.java @@ -0,0 +1,570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.BuildServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultLogInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.models.Build; +import com.azure.resourcemanager.appplatform.generated.models.BuildResult; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultLog; +import com.azure.resourcemanager.appplatform.generated.models.BuildService; +import com.azure.resourcemanager.appplatform.generated.models.BuildServices; +import com.azure.resourcemanager.appplatform.generated.models.ResourceUploadDefinition; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpackResource; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpacksCollection; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStackResource; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStacksCollection; + +public final class BuildServicesImpl implements BuildServices { + private static final ClientLogger LOGGER = new ClientLogger(BuildServicesImpl.class); + + private final BuildServicesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public BuildServicesImpl( + BuildServicesClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBuildServices(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().listBuildServices(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new BuildServiceImpl(inner1, this.manager())); + } + + public PagedIterable listBuildServices( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listBuildServices(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new BuildServiceImpl(inner1, this.manager())); + } + + public Response getBuildServiceWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + Response inner = + this.serviceClient().getBuildServiceWithResponse(resourceGroupName, serviceName, buildServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuildServiceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildService getBuildService(String resourceGroupName, String serviceName, String buildServiceName) { + BuildServiceInner inner = + this.serviceClient().getBuildService(resourceGroupName, serviceName, buildServiceName); + if (inner != null) { + return new BuildServiceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listBuilds(String resourceGroupName, String serviceName, String buildServiceName) { + PagedIterable inner = + this.serviceClient().listBuilds(resourceGroupName, serviceName, buildServiceName); + return Utils.mapPage(inner, inner1 -> new BuildImpl(inner1, this.manager())); + } + + public PagedIterable listBuilds( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listBuilds(resourceGroupName, serviceName, buildServiceName, context); + return Utils.mapPage(inner, inner1 -> new BuildImpl(inner1, this.manager())); + } + + public Response getBuildWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + Response inner = + this + .serviceClient() + .getBuildWithResponse(resourceGroupName, serviceName, buildServiceName, buildName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuildImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Build getBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + BuildInner inner = this.serviceClient().getBuild(resourceGroupName, serviceName, buildServiceName, buildName); + if (inner != null) { + return new BuildImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + this.serviceClient().deleteBuild(resourceGroupName, serviceName, buildServiceName, buildName); + } + + public void deleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + this.serviceClient().deleteBuild(resourceGroupName, serviceName, buildServiceName, buildName, context); + } + + public PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName) { + PagedIterable inner = + this.serviceClient().listBuildResults(resourceGroupName, serviceName, buildServiceName, buildName); + return Utils.mapPage(inner, inner1 -> new BuildResultImpl(inner1, this.manager())); + } + + public PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context) { + PagedIterable inner = + this.serviceClient().listBuildResults(resourceGroupName, serviceName, buildServiceName, buildName, context); + return Utils.mapPage(inner, inner1 -> new BuildResultImpl(inner1, this.manager())); + } + + public Response getBuildResultWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context) { + Response inner = + this + .serviceClient() + .getBuildResultWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuildResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildResult getBuildResult( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + BuildResultInner inner = + this + .serviceClient() + .getBuildResult(resourceGroupName, serviceName, buildServiceName, buildName, buildResultName); + if (inner != null) { + return new BuildResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getBuildResultLogWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context) { + Response inner = + this + .serviceClient() + .getBuildResultLogWithResponse( + resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuildResultLogImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildResultLog getBuildResultLog( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName) { + BuildResultLogInner inner = + this + .serviceClient() + .getBuildResultLog(resourceGroupName, serviceName, buildServiceName, buildName, buildResultName); + if (inner != null) { + return new BuildResultLogImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + Response inner = + this + .serviceClient() + .getResourceUploadUrlWithResponse(resourceGroupName, serviceName, buildServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ResourceUploadDefinitionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ResourceUploadDefinition getResourceUploadUrl( + String resourceGroupName, String serviceName, String buildServiceName) { + ResourceUploadDefinitionInner inner = + this.serviceClient().getResourceUploadUrl(resourceGroupName, serviceName, buildServiceName); + if (inner != null) { + return new ResourceUploadDefinitionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSupportedBuildpacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + Response inner = + this + .serviceClient() + .listSupportedBuildpacksWithResponse(resourceGroupName, serviceName, buildServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SupportedBuildpacksCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedBuildpacksCollection listSupportedBuildpacks( + String resourceGroupName, String serviceName, String buildServiceName) { + SupportedBuildpacksCollectionInner inner = + this.serviceClient().listSupportedBuildpacks(resourceGroupName, serviceName, buildServiceName); + if (inner != null) { + return new SupportedBuildpacksCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSupportedBuildpackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName, Context context) { + Response inner = + this + .serviceClient() + .getSupportedBuildpackWithResponse( + resourceGroupName, serviceName, buildServiceName, buildpackName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SupportedBuildpackResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedBuildpackResource getSupportedBuildpack( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName) { + SupportedBuildpackResourceInner inner = + this.serviceClient().getSupportedBuildpack(resourceGroupName, serviceName, buildServiceName, buildpackName); + if (inner != null) { + return new SupportedBuildpackResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSupportedStacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + Response inner = + this + .serviceClient() + .listSupportedStacksWithResponse(resourceGroupName, serviceName, buildServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SupportedStacksCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedStacksCollection listSupportedStacks( + String resourceGroupName, String serviceName, String buildServiceName) { + SupportedStacksCollectionInner inner = + this.serviceClient().listSupportedStacks(resourceGroupName, serviceName, buildServiceName); + if (inner != null) { + return new SupportedStacksCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSupportedStackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String stackName, Context context) { + Response inner = + this + .serviceClient() + .getSupportedStackWithResponse(resourceGroupName, serviceName, buildServiceName, stackName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SupportedStackResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SupportedStackResource getSupportedStack( + String resourceGroupName, String serviceName, String buildServiceName, String stackName) { + SupportedStackResourceInner inner = + this.serviceClient().getSupportedStack(resourceGroupName, serviceName, buildServiceName, stackName); + if (inner != null) { + return new SupportedStackResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public BuildService getBuildServiceById(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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + return this + .getBuildServiceWithResponse(resourceGroupName, serviceName, buildServiceName, Context.NONE) + .getValue(); + } + + public Response getBuildServiceByIdWithResponse(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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + return this.getBuildServiceWithResponse(resourceGroupName, serviceName, buildServiceName, context); + } + + public Build getBuildById(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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String buildName = Utils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + return this + .getBuildWithResponse(resourceGroupName, serviceName, buildServiceName, buildName, Context.NONE) + .getValue(); + } + + public Response getBuildByIdWithResponse(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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String buildName = Utils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + return this.getBuildWithResponse(resourceGroupName, serviceName, buildServiceName, buildName, context); + } + + public void deleteBuildById(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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String buildName = Utils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + this.deleteBuild(resourceGroupName, serviceName, buildServiceName, buildName, Context.NONE); + } + + public void deleteBuildByIdWithResponse(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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String buildName = Utils.getValueFromIdByName(id, "builds"); + if (buildName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builds'.", id))); + } + this.deleteBuild(resourceGroupName, serviceName, buildServiceName, buildName, context); + } + + private BuildServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public BuildServiceImpl define(String name) { + return new BuildServiceImpl(name, this.manager()); + } + + public BuildImpl defineBuild(String name) { + return new BuildImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuilderResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuilderResourceImpl.java new file mode 100644 index 0000000000000..2fc5156e9d2f8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuilderResourceImpl.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuilderProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuilderResource; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentList; + +public final class BuilderResourceImpl implements BuilderResource, BuilderResource.Definition, BuilderResource.Update { + private BuilderResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BuilderProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BuilderResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String buildServiceName; + + private String builderName; + + public BuilderResourceImpl withExistingBuildService( + String resourceGroupName, String serviceName, String buildServiceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.buildServiceName = buildServiceName; + return this; + } + + public BuilderResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServiceBuilders() + .createOrUpdate( + resourceGroupName, serviceName, buildServiceName, builderName, this.innerModel(), Context.NONE); + return this; + } + + public BuilderResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServiceBuilders() + .createOrUpdate( + resourceGroupName, serviceName, buildServiceName, builderName, this.innerModel(), context); + return this; + } + + BuilderResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new BuilderResourceInner(); + this.serviceManager = serviceManager; + this.builderName = name; + } + + public BuilderResourceImpl update() { + return this; + } + + public BuilderResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServiceBuilders() + .createOrUpdate( + resourceGroupName, serviceName, buildServiceName, builderName, this.innerModel(), Context.NONE); + return this; + } + + public BuilderResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServiceBuilders() + .createOrUpdate( + resourceGroupName, serviceName, buildServiceName, builderName, this.innerModel(), context); + return this; + } + + BuilderResourceImpl( + BuilderResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.buildServiceName = Utils.getValueFromIdByName(innerObject.id(), "buildServices"); + this.builderName = Utils.getValueFromIdByName(innerObject.id(), "builders"); + } + + public BuilderResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServiceBuilders() + .getWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, Context.NONE) + .getValue(); + return this; + } + + public BuilderResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildServiceBuilders() + .getWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, context) + .getValue(); + return this; + } + + public Response listDeploymentsWithResponse(Context context) { + return serviceManager + .buildServiceBuilders() + .listDeploymentsWithResponse(resourceGroupName, serviceName, buildServiceName, builderName, context); + } + + public DeploymentList listDeployments() { + return serviceManager + .buildServiceBuilders() + .listDeployments(resourceGroupName, serviceName, buildServiceName, builderName); + } + + public BuilderResourceImpl withProperties(BuilderProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingResourceImpl.java new file mode 100644 index 0000000000000..7f298e79e207c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingResourceImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingResource; + +public final class BuildpackBindingResourceImpl + implements BuildpackBindingResource, BuildpackBindingResource.Definition, BuildpackBindingResource.Update { + private BuildpackBindingResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BuildpackBindingProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public BuildpackBindingResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String buildServiceName; + + private String builderName; + + private String buildpackBindingName; + + public BuildpackBindingResourceImpl withExistingBuilder( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.buildServiceName = buildServiceName; + this.builderName = builderName; + return this; + } + + public BuildpackBindingResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildpackBindings() + .createOrUpdate( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + this.innerModel(), + Context.NONE); + return this; + } + + public BuildpackBindingResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildpackBindings() + .createOrUpdate( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + this.innerModel(), + context); + return this; + } + + BuildpackBindingResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new BuildpackBindingResourceInner(); + this.serviceManager = serviceManager; + this.buildpackBindingName = name; + } + + public BuildpackBindingResourceImpl update() { + return this; + } + + public BuildpackBindingResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildpackBindings() + .createOrUpdate( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + this.innerModel(), + Context.NONE); + return this; + } + + public BuildpackBindingResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildpackBindings() + .createOrUpdate( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + this.innerModel(), + context); + return this; + } + + BuildpackBindingResourceImpl( + BuildpackBindingResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.buildServiceName = Utils.getValueFromIdByName(innerObject.id(), "buildServices"); + this.builderName = Utils.getValueFromIdByName(innerObject.id(), "builders"); + this.buildpackBindingName = Utils.getValueFromIdByName(innerObject.id(), "buildpackBindings"); + } + + public BuildpackBindingResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBuildpackBindings() + .getWithResponse( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, Context.NONE) + .getValue(); + return this; + } + + public BuildpackBindingResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBuildpackBindings() + .getWithResponse( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context) + .getValue(); + return this; + } + + public BuildpackBindingResourceImpl withProperties(BuildpackBindingProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsClientImpl.java new file mode 100644 index 0000000000000..53ced7bbb8606 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsClientImpl.java @@ -0,0 +1,1747 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.BuildpackBindingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingResourceCollection; +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 BuildpackBindingsClient. */ +public final class BuildpackBindingsClientImpl implements BuildpackBindingsClient { + /** The proxy service used to perform REST calls. */ + private final BuildpackBindingsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of BuildpackBindingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BuildpackBindingsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(BuildpackBindingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientBuildpackBindings to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface BuildpackBindingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForCluster( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @PathParam("buildpackBindingName") String buildpackBindingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @PathParam("buildpackBindingName") String buildpackBindingName, + @BodyParam("application/json") BuildpackBindingResourceInner buildpackBinding, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings/{buildpackBindingName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @PathParam("buildpackBindingName") String buildpackBindingName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/buildpackBindings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("buildServiceName") String buildServiceName, + @PathParam("builderName") String builderName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForClusterNext( + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listForCluster( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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 collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listForCluster( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listForClusterNextSinglePageAsync(nextLink)); + } + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listForClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForCluster(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listForClusterAsync(resourceGroupName, serviceName)); + } + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForCluster( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listForClusterAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 buildpack binding by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildpackBindingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBindingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 buildpack binding by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildpackBindingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBindingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + accept, + context); + } + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 buildpack binding by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + return getWithResponseAsync(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 buildpack binding by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + return getWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context) + .block(); + } + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 buildpack binding by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildpackBindingResourceInner get( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + return getWithResponse( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, Context.NONE) + .getValue(); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildpackBindingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBindingName is required and cannot be null.")); + } + if (buildpackBinding == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBinding is required and cannot be null.")); + } else { + buildpackBinding.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildpackBindingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBindingName is required and cannot be null.")); + } + if (buildpackBinding == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBinding is required and cannot be null.")); + } else { + buildpackBinding.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding, + accept, + context); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildpackBindingResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BuildpackBindingResourceInner.class, + BuildpackBindingResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, BuildpackBindingResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BuildpackBindingResourceInner.class, + BuildpackBindingResourceInner.class, + context); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildpackBindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding) + .getSyncPoller(); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildpackBindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding, + context) + .getSyncPoller(); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildpackBindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding) { + return createOrUpdateAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding) + .block(); + } + + /** + * Create or update a buildpack binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding Name. + * @param buildpackBinding The target buildpack binding for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return buildpack Binding Resource object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BuildpackBindingResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + buildpackBinding, + context) + .block(); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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>> deleteWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildpackBindingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBindingName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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>> deleteWithResponseAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + if (buildpackBindingName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildpackBindingName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + buildpackBindingName, + accept, + context); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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> beginDeleteAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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> beginDeleteAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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> beginDelete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + return this + .beginDeleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName) + .getSyncPoller(); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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> beginDelete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + return this + .beginDeleteAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context) + .getSyncPoller(); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 deleteAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + return beginDeleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 deleteAsync( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + return beginDeleteAsync( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + deleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName).block(); + } + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + deleteAsync(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context) + .block(); + } + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + 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())); + } + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (buildServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter buildServiceName is required and cannot be null.")); + } + if (builderName == null) { + return Mono.error(new IllegalArgumentException("Parameter builderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + buildServiceName, + builderName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, buildServiceName, builderName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, buildServiceName, builderName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName, builderName)); + } + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName, builderName, 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 object that includes an array of BuildpackBinding resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterNextSinglePageAsync(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.listForClusterNext(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 object that includes an array of BuildpackBinding resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterNextSinglePageAsync( + 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 + .listForClusterNext(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 object that includes an array of BuildpackBinding resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of BuildpackBinding resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsImpl.java new file mode 100644 index 0000000000000..b223384b5d49e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsImpl.java @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.BuildpackBindingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingResource; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindings; + +public final class BuildpackBindingsImpl implements BuildpackBindings { + private static final ClientLogger LOGGER = new ClientLogger(BuildpackBindingsImpl.class); + + private final BuildpackBindingsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public BuildpackBindingsImpl( + BuildpackBindingsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listForCluster(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listForCluster(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new BuildpackBindingResourceImpl(inner1, this.manager())); + } + + public PagedIterable listForCluster( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listForCluster(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new BuildpackBindingResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BuildpackBindingResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BuildpackBindingResource get( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + BuildpackBindingResourceInner inner = + this + .serviceClient() + .get(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName); + if (inner != null) { + return new BuildpackBindingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + this + .serviceClient() + .delete(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName); + } + + public void delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, buildServiceName, builderName); + return Utils.mapPage(inner, inner1 -> new BuildpackBindingResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, buildServiceName, builderName, context); + return Utils.mapPage(inner, inner1 -> new BuildpackBindingResourceImpl(inner1, this.manager())); + } + + public BuildpackBindingResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildpackBindingName = Utils.getValueFromIdByName(id, "buildpackBindings"); + if (buildpackBindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'buildpackBindings'.", id))); + } + return this + .getWithResponse( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildpackBindingName = Utils.getValueFromIdByName(id, "buildpackBindings"); + if (buildpackBindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'buildpackBindings'.", id))); + } + return this + .getWithResponse( + resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildpackBindingName = Utils.getValueFromIdByName(id, "buildpackBindings"); + if (buildpackBindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'buildpackBindings'.", id))); + } + this.delete(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String buildServiceName = Utils.getValueFromIdByName(id, "buildServices"); + if (buildServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'buildServices'.", id))); + } + String builderName = Utils.getValueFromIdByName(id, "builders"); + if (builderName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'builders'.", id))); + } + String buildpackBindingName = Utils.getValueFromIdByName(id, "buildpackBindings"); + if (buildpackBindingName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'buildpackBindings'.", id))); + } + this.delete(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, context); + } + + private BuildpackBindingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public BuildpackBindingResourceImpl define(String name) { + return new BuildpackBindingResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificateResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificateResourceImpl.java new file mode 100644 index 0000000000000..2ba5b6f74caf8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificateResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CertificateProperties; +import com.azure.resourcemanager.appplatform.generated.models.CertificateResource; + +public final class CertificateResourceImpl + implements CertificateResource, CertificateResource.Definition, CertificateResource.Update { + private CertificateResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CertificateProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CertificateResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String certificateName; + + public CertificateResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public CertificateResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdate(resourceGroupName, serviceName, certificateName, this.innerModel(), Context.NONE); + return this; + } + + public CertificateResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdate(resourceGroupName, serviceName, certificateName, this.innerModel(), context); + return this; + } + + CertificateResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new CertificateResourceInner(); + this.serviceManager = serviceManager; + this.certificateName = name; + } + + public CertificateResourceImpl update() { + return this; + } + + public CertificateResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdate(resourceGroupName, serviceName, certificateName, this.innerModel(), Context.NONE); + return this; + } + + public CertificateResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .createOrUpdate(resourceGroupName, serviceName, certificateName, this.innerModel(), context); + return this; + } + + CertificateResourceImpl( + CertificateResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.certificateName = Utils.getValueFromIdByName(innerObject.id(), "certificates"); + } + + public CertificateResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, serviceName, certificateName, Context.NONE) + .getValue(); + return this; + } + + public CertificateResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCertificates() + .getWithResponse(resourceGroupName, serviceName, certificateName, context) + .getValue(); + return this; + } + + public CertificateResourceImpl withProperties(CertificateProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesClientImpl.java new file mode 100644 index 0000000000000..fde8db77aa142 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesClientImpl.java @@ -0,0 +1,1174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.CertificatesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CertificateResourceCollection; +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 CertificatesClient. */ +public final class CertificatesClientImpl implements CertificatesClient { + /** The proxy service used to perform REST calls. */ + private final CertificatesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of CertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CertificatesClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCertificates to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface CertificatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") CertificateResourceInner certificateResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("certificateName") String certificateName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + accept, + context); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String certificateName) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, certificateName, context).block(); + } + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner get(String resourceGroupName, String serviceName, String certificateName) { + return getWithResponse(resourceGroupName, serviceName, certificateName, Context.NONE).getValue(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (certificateResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateResource is required and cannot be null.")); + } else { + certificateResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + certificateResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (certificateResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateResource is required and cannot be null.")); + } else { + certificateResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + certificateResource, + accept, + context); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CertificateResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, certificateName, certificateResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CertificateResourceInner.class, + CertificateResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CertificateResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, certificateName, certificateResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CertificateResourceInner.class, + CertificateResourceInner.class, + context); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CertificateResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource) + .getSyncPoller(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CertificateResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource, context) + .getSyncPoller(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource).block(); + } + + /** + * Create or update certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param certificateResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CertificateResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, certificateName, certificateResource, context) + .block(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String certificateName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (certificateName == null) { + return Mono + .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + certificateName, + accept, + context); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String certificateName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, certificateName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, certificateName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String certificateName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, certificateName).getSyncPoller(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, certificateName, context).getSyncPoller(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String certificateName) { + return beginDeleteAsync(resourceGroupName, serviceName, certificateName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, certificateName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String certificateName) { + deleteAsync(resourceGroupName, serviceName, certificateName).block(); + } + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String certificateName, Context context) { + deleteAsync(resourceGroupName, serviceName, certificateName, context).block(); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, 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 collection compose of certificate resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 collection compose of certificate resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesImpl.java new file mode 100644 index 0000000000000..705cd38c67684 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.CertificatesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CertificateResource; +import com.azure.resourcemanager.appplatform.generated.models.Certificates; + +public final class CertificatesImpl implements Certificates { + private static final ClientLogger LOGGER = new ClientLogger(CertificatesImpl.class); + + private final CertificatesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public CertificatesImpl( + CertificatesClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String certificateName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, certificateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CertificateResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CertificateResource get(String resourceGroupName, String serviceName, String certificateName) { + CertificateResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, certificateName); + if (inner != null) { + return new CertificateResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String certificateName) { + this.serviceClient().delete(resourceGroupName, serviceName, certificateName); + } + + public void delete(String resourceGroupName, String serviceName, String certificateName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, certificateName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new CertificateResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new CertificateResourceImpl(inner1, this.manager())); + } + + public CertificateResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, certificateName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, certificateName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + this.delete(resourceGroupName, serviceName, certificateName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String certificateName = Utils.getValueFromIdByName(id, "certificates"); + if (certificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); + } + this.delete(resourceGroupName, serviceName, certificateName, context); + } + + private CertificatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public CertificateResourceImpl define(String name) { + return new CertificateResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerResourceImpl.java new file mode 100644 index 0000000000000..3256b7abdf725 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerResource; + +public final class ConfigServerResourceImpl implements ConfigServerResource { + private ConfigServerResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ConfigServerResourceImpl( + ConfigServerResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 ConfigServerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ConfigServerResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerSettingsValidateResultImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerSettingsValidateResultImpl.java new file mode 100644 index 0000000000000..77a538beabb26 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerSettingsValidateResultImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettingsErrorRecord; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettingsValidateResult; +import java.util.Collections; +import java.util.List; + +public final class ConfigServerSettingsValidateResultImpl implements ConfigServerSettingsValidateResult { + private ConfigServerSettingsValidateResultInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ConfigServerSettingsValidateResultImpl( + ConfigServerSettingsValidateResultInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isValid() { + return this.innerModel().isValid(); + } + + public List details() { + List inner = this.innerModel().details(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ConfigServerSettingsValidateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersClientImpl.java new file mode 100644 index 0000000000000..83ee20623b989 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersClientImpl.java @@ -0,0 +1,1127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.appplatform.generated.fluent.ConfigServersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +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 ConfigServersClient. */ +public final class ConfigServersClientImpl implements ConfigServersClient { + /** The proxy service used to perform REST calls. */ + private final ConfigServersService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ConfigServersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigServersClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(ConfigServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientConfigServers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ConfigServersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePut( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ConfigServerResourceInner configServerResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePatch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ConfigServerResourceInner configServerResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ConfigServerSettings configServerSettings, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName) { + return getWithResponseAsync(resourceGroupName, serviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerResourceInner get(String resourceGroupName, String serviceName) { + return getWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter configServerResource is required and cannot be null.")); + } else { + configServerResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configServerResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter configServerResource is required and cannot be null.")); + } else { + configServerResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configServerResource, + accept, + context); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServerResourceInner> beginUpdatePutAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + Mono>> mono = + updatePutWithResponseAsync(resourceGroupName, serviceName, configServerResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigServerResourceInner.class, + ConfigServerResourceInner.class, + this.client.getContext()); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServerResourceInner> beginUpdatePutAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePutWithResponseAsync(resourceGroupName, serviceName, configServerResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigServerResourceInner.class, + ConfigServerResourceInner.class, + context); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return this.beginUpdatePutAsync(resourceGroupName, serviceName, configServerResource).getSyncPoller(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return this.beginUpdatePutAsync(resourceGroupName, serviceName, configServerResource, context).getSyncPoller(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return beginUpdatePutAsync(resourceGroupName, serviceName, configServerResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return beginUpdatePutAsync(resourceGroupName, serviceName, configServerResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerResourceInner updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return updatePutAsync(resourceGroupName, serviceName, configServerResource).block(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerResourceInner updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return updatePutAsync(resourceGroupName, serviceName, configServerResource, context).block(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePatchWithResponseAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter configServerResource is required and cannot be null.")); + } else { + configServerResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePatch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configServerResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePatchWithResponseAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter configServerResource is required and cannot be null.")); + } else { + configServerResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePatch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configServerResource, + accept, + context); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServerResourceInner> beginUpdatePatchAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + Mono>> mono = + updatePatchWithResponseAsync(resourceGroupName, serviceName, configServerResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigServerResourceInner.class, + ConfigServerResourceInner.class, + this.client.getContext()); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServerResourceInner> beginUpdatePatchAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePatchWithResponseAsync(resourceGroupName, serviceName, configServerResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigServerResourceInner.class, + ConfigServerResourceInner.class, + context); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return this.beginUpdatePatchAsync(resourceGroupName, serviceName, configServerResource).getSyncPoller(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of config Server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return this + .beginUpdatePatchAsync(resourceGroupName, serviceName, configServerResource, context) + .getSyncPoller(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePatchAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return beginUpdatePatchAsync(resourceGroupName, serviceName, configServerResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePatchAsync( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return beginUpdatePatchAsync(resourceGroupName, serviceName, configServerResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerResourceInner updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return updatePatchAsync(resourceGroupName, serviceName, configServerResource).block(); + } + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerResourceInner updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return updatePatchAsync(resourceGroupName, serviceName, configServerResource, context).block(); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configServerSettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter configServerSettings is required and cannot be null.")); + } else { + configServerSettings.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configServerSettings, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configServerSettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter configServerSettings is required and cannot be null.")); + } else { + configServerSettings.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configServerSettings, + accept, + context); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServerSettingsValidateResultInner> + beginValidateAsync(String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + Mono>> mono = + validateWithResponseAsync(resourceGroupName, serviceName, configServerSettings); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigServerSettingsValidateResultInner.class, + ConfigServerSettingsValidateResultInner.class, + this.client.getContext()); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigServerSettingsValidateResultInner> + beginValidateAsync( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateWithResponseAsync(resourceGroupName, serviceName, configServerSettings, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigServerSettingsValidateResultInner.class, + ConfigServerSettingsValidateResultInner.class, + context); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerSettingsValidateResultInner> + beginValidate(String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + return this.beginValidateAsync(resourceGroupName, serviceName, configServerSettings).getSyncPoller(); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerSettingsValidateResultInner> + beginValidate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context) { + return this.beginValidateAsync(resourceGroupName, serviceName, configServerSettings, context).getSyncPoller(); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + return beginValidateAsync(resourceGroupName, serviceName, configServerSettings) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context) { + return beginValidateAsync(resourceGroupName, serviceName, configServerSettings, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerSettingsValidateResultInner validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + return validateAsync(resourceGroupName, serviceName, configServerSettings).block(); + } + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigServerSettingsValidateResultInner validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context) { + return validateAsync(resourceGroupName, serviceName, configServerSettings, context).block(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersImpl.java new file mode 100644 index 0000000000000..72a2f25e63f84 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersImpl.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ConfigServersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerResource; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettingsValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServers; + +public final class ConfigServersImpl implements ConfigServers { + private static final ClientLogger LOGGER = new ClientLogger(ConfigServersImpl.class); + + private final ConfigServersClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ConfigServersImpl( + ConfigServersClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConfigServerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigServerResource get(String resourceGroupName, String serviceName) { + ConfigServerResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName); + if (inner != null) { + return new ConfigServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigServerResource updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + ConfigServerResourceInner inner = + this.serviceClient().updatePut(resourceGroupName, serviceName, configServerResource); + if (inner != null) { + return new ConfigServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigServerResource updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + ConfigServerResourceInner inner = + this.serviceClient().updatePut(resourceGroupName, serviceName, configServerResource, context); + if (inner != null) { + return new ConfigServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigServerResource updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + ConfigServerResourceInner inner = + this.serviceClient().updatePatch(resourceGroupName, serviceName, configServerResource); + if (inner != null) { + return new ConfigServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigServerResource updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + ConfigServerResourceInner inner = + this.serviceClient().updatePatch(resourceGroupName, serviceName, configServerResource, context); + if (inner != null) { + return new ConfigServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigServerSettingsValidateResult validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + ConfigServerSettingsValidateResultInner inner = + this.serviceClient().validate(resourceGroupName, serviceName, configServerSettings); + if (inner != null) { + return new ConfigServerSettingsValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigServerSettingsValidateResult validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context) { + ConfigServerSettingsValidateResultInner inner = + this.serviceClient().validate(resourceGroupName, serviceName, configServerSettings, context); + if (inner != null) { + return new ConfigServerSettingsValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private ConfigServersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceResourceImpl.java new file mode 100644 index 0000000000000..85c76f0e7fb1e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceResourceImpl.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceResource; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettingsValidateResult; + +public final class ConfigurationServiceResourceImpl + implements ConfigurationServiceResource, + ConfigurationServiceResource.Definition, + ConfigurationServiceResource.Update { + private ConfigurationServiceResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ConfigurationServiceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConfigurationServiceResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String configurationServiceName; + + public ConfigurationServiceResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ConfigurationServiceResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationServices() + .createOrUpdate( + resourceGroupName, serviceName, configurationServiceName, this.innerModel(), Context.NONE); + return this; + } + + public ConfigurationServiceResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationServices() + .createOrUpdate(resourceGroupName, serviceName, configurationServiceName, this.innerModel(), context); + return this; + } + + ConfigurationServiceResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ConfigurationServiceResourceInner(); + this.serviceManager = serviceManager; + this.configurationServiceName = name; + } + + public ConfigurationServiceResourceImpl update() { + return this; + } + + public ConfigurationServiceResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationServices() + .createOrUpdate( + resourceGroupName, serviceName, configurationServiceName, this.innerModel(), Context.NONE); + return this; + } + + public ConfigurationServiceResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationServices() + .createOrUpdate(resourceGroupName, serviceName, configurationServiceName, this.innerModel(), context); + return this; + } + + ConfigurationServiceResourceImpl( + ConfigurationServiceResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.configurationServiceName = Utils.getValueFromIdByName(innerObject.id(), "configurationServices"); + } + + public ConfigurationServiceResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationServices() + .getWithResponse(resourceGroupName, serviceName, configurationServiceName, Context.NONE) + .getValue(); + return this; + } + + public ConfigurationServiceResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConfigurationServices() + .getWithResponse(resourceGroupName, serviceName, configurationServiceName, context) + .getValue(); + return this; + } + + public ConfigurationServiceSettingsValidateResult validate(ConfigurationServiceSettings settings) { + return serviceManager + .configurationServices() + .validate(resourceGroupName, serviceName, configurationServiceName, settings); + } + + public ConfigurationServiceSettingsValidateResult validate(ConfigurationServiceSettings settings, Context context) { + return serviceManager + .configurationServices() + .validate(resourceGroupName, serviceName, configurationServiceName, settings, context); + } + + public ConfigurationServiceSettingsValidateResult validateResource( + ConfigurationServiceResourceInner configurationServiceResource) { + return serviceManager + .configurationServices() + .validateResource(resourceGroupName, serviceName, configurationServiceName, configurationServiceResource); + } + + public ConfigurationServiceSettingsValidateResult validateResource( + ConfigurationServiceResourceInner configurationServiceResource, Context context) { + return serviceManager + .configurationServices() + .validateResource( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context); + } + + public ConfigurationServiceResourceImpl withProperties(ConfigurationServiceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceSettingsValidateResultImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceSettingsValidateResultImpl.java new file mode 100644 index 0000000000000..99bae955130b8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceSettingsValidateResultImpl.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitPropertyValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettingsValidateResult; + +public final class ConfigurationServiceSettingsValidateResultImpl + implements ConfigurationServiceSettingsValidateResult { + private ConfigurationServiceSettingsValidateResultInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ConfigurationServiceSettingsValidateResultImpl( + ConfigurationServiceSettingsValidateResultInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ConfigurationServiceGitPropertyValidateResult gitPropertyValidationResult() { + return this.innerModel().gitPropertyValidationResult(); + } + + public ConfigurationServiceSettingsValidateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesClientImpl.java new file mode 100644 index 0000000000000..276756a682c3d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesClientImpl.java @@ -0,0 +1,1971 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.ConfigurationServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +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 ConfigurationServicesClient. */ +public final class ConfigurationServicesClientImpl implements ConfigurationServicesClient { + /** The proxy service used to perform REST calls. */ + private final ConfigurationServicesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ConfigurationServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConfigurationServicesClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(ConfigurationServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientConfigurationServices to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ConfigurationServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("configurationServiceName") String configurationServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("configurationServiceName") String configurationServiceName, + @BodyParam("application/json") ConfigurationServiceResourceInner configurationServiceResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("configurationServiceName") String configurationServiceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("configurationServiceName") String configurationServiceName, + @BodyParam("application/json") ConfigurationServiceSettings settings, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validateResource( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("configurationServiceName") String configurationServiceName, + @BodyParam("application/json") ConfigurationServiceResourceInner configurationServiceResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String configurationServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String configurationServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + accept, + context); + } + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String configurationServiceName) { + return getWithResponseAsync(resourceGroupName, serviceName, configurationServiceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String configurationServiceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, configurationServiceName, context).block(); + } + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceResourceInner get( + String resourceGroupName, String serviceName, String configurationServiceName) { + return getWithResponse(resourceGroupName, serviceName, configurationServiceName, Context.NONE).getValue(); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + if (configurationServiceResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationServiceResource is required and cannot be null.")); + } else { + configurationServiceResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + if (configurationServiceResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationServiceResource is required and cannot be null.")); + } else { + configurationServiceResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource, + accept, + context); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationServiceResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationServiceResourceInner.class, + ConfigurationServiceResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ConfigurationServiceResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationServiceResourceInner.class, + ConfigurationServiceResourceInner.class, + context); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationServiceResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource) + .getSyncPoller(); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationServiceResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context) + .getSyncPoller(); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return createOrUpdateAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource) + .block(); + } + + /** + * Create the default Application Configuration Service or update the existing Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return application Configuration Service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context) + .block(); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String configurationServiceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String configurationServiceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + accept, + context); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String configurationServiceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, configurationServiceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String configurationServiceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, configurationServiceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String configurationServiceName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, configurationServiceName).getSyncPoller(); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String configurationServiceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, configurationServiceName, context).getSyncPoller(); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String configurationServiceName) { + return beginDeleteAsync(resourceGroupName, serviceName, configurationServiceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String configurationServiceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, configurationServiceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String configurationServiceName) { + deleteAsync(resourceGroupName, serviceName, configurationServiceName).block(); + } + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String configurationServiceName, Context context) { + deleteAsync(resourceGroupName, serviceName, configurationServiceName, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + if (settings == null) { + return Mono.error(new IllegalArgumentException("Parameter settings is required and cannot be null.")); + } else { + settings.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + settings, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + if (settings == null) { + return Mono.error(new IllegalArgumentException("Parameter settings is required and cannot be null.")); + } else { + settings.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + settings, + accept, + context); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + Mono>> mono = + validateWithResponseAsync(resourceGroupName, serviceName, configurationServiceName, settings); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationServiceSettingsValidateResultInner.class, + ConfigurationServiceSettingsValidateResultInner.class, + this.client.getContext()); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateWithResponseAsync(resourceGroupName, serviceName, configurationServiceName, settings, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationServiceSettingsValidateResultInner.class, + ConfigurationServiceSettingsValidateResultInner.class, + context); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + return this + .beginValidateAsync(resourceGroupName, serviceName, configurationServiceName, settings) + .getSyncPoller(); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context) { + return this + .beginValidateAsync(resourceGroupName, serviceName, configurationServiceName, settings, context) + .getSyncPoller(); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + return beginValidateAsync(resourceGroupName, serviceName, configurationServiceName, settings) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context) { + return beginValidateAsync(resourceGroupName, serviceName, configurationServiceName, settings, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceSettingsValidateResultInner validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + return validateAsync(resourceGroupName, serviceName, configurationServiceName, settings).block(); + } + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceSettingsValidateResultInner validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context) { + return validateAsync(resourceGroupName, serviceName, configurationServiceName, settings, context).block(); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateResourceWithResponseAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + if (configurationServiceResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationServiceResource is required and cannot be null.")); + } else { + configurationServiceResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateResource( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateResourceWithResponseAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (configurationServiceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter configurationServiceName is required and cannot be null.")); + } + if (configurationServiceResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter configurationServiceResource is required and cannot be null.")); + } else { + configurationServiceResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateResource( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + configurationServiceName, + configurationServiceResource, + accept, + context); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateResourceAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + Mono>> mono = + validateResourceWithResponseAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationServiceSettingsValidateResultInner.class, + ConfigurationServiceSettingsValidateResultInner.class, + this.client.getContext()); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateResourceAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateResourceWithResponseAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context); + return this + .client + . + getLroResult( + mono, + this.client.getHttpPipeline(), + ConfigurationServiceSettingsValidateResultInner.class, + ConfigurationServiceSettingsValidateResultInner.class, + context); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return this + .beginValidateResourceAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource) + .getSyncPoller(); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return this + .beginValidateResourceAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context) + .getSyncPoller(); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateResourceAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return beginValidateResourceAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateResourceAsync( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return beginValidateResourceAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceSettingsValidateResultInner validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return validateResourceAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource) + .block(); + } + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConfigurationServiceSettingsValidateResultInner validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return validateResourceAsync( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of configuration service resources and a possible link for next set along + * with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesImpl.java new file mode 100644 index 0000000000000..0a9e9f3f8a0fe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ConfigurationServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceSettingsValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceResource; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettingsValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServices; + +public final class ConfigurationServicesImpl implements ConfigurationServices { + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationServicesImpl.class); + + private final ConfigurationServicesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ConfigurationServicesImpl( + ConfigurationServicesClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String configurationServiceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, configurationServiceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConfigurationServiceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ConfigurationServiceResource get( + String resourceGroupName, String serviceName, String configurationServiceName) { + ConfigurationServiceResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, configurationServiceName); + if (inner != null) { + return new ConfigurationServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String configurationServiceName) { + this.serviceClient().delete(resourceGroupName, serviceName, configurationServiceName); + } + + public void delete(String resourceGroupName, String serviceName, String configurationServiceName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, configurationServiceName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ConfigurationServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ConfigurationServiceResourceImpl(inner1, this.manager())); + } + + public ConfigurationServiceSettingsValidateResult validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + ConfigurationServiceSettingsValidateResultInner inner = + this.serviceClient().validate(resourceGroupName, serviceName, configurationServiceName, settings); + if (inner != null) { + return new ConfigurationServiceSettingsValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationServiceSettingsValidateResult validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context) { + ConfigurationServiceSettingsValidateResultInner inner = + this.serviceClient().validate(resourceGroupName, serviceName, configurationServiceName, settings, context); + if (inner != null) { + return new ConfigurationServiceSettingsValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationServiceSettingsValidateResult validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + ConfigurationServiceSettingsValidateResultInner inner = + this + .serviceClient() + .validateResource( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource); + if (inner != null) { + return new ConfigurationServiceSettingsValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationServiceSettingsValidateResult validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + ConfigurationServiceSettingsValidateResultInner inner = + this + .serviceClient() + .validateResource( + resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, context); + if (inner != null) { + return new ConfigurationServiceSettingsValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ConfigurationServiceResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String configurationServiceName = Utils.getValueFromIdByName(id, "configurationServices"); + if (configurationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationServices'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, configurationServiceName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String configurationServiceName = Utils.getValueFromIdByName(id, "configurationServices"); + if (configurationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationServices'.", + id))); + } + return this.getWithResponse(resourceGroupName, serviceName, configurationServiceName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String configurationServiceName = Utils.getValueFromIdByName(id, "configurationServices"); + if (configurationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationServices'.", + id))); + } + this.delete(resourceGroupName, serviceName, configurationServiceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String configurationServiceName = Utils.getValueFromIdByName(id, "configurationServices"); + if (configurationServiceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'configurationServices'.", + id))); + } + this.delete(resourceGroupName, serviceName, configurationServiceName, context); + } + + private ConfigurationServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ConfigurationServiceResourceImpl define(String name) { + return new ConfigurationServiceResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistriesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistriesClientImpl.java new file mode 100644 index 0000000000000..8b187678e7e76 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistriesClientImpl.java @@ -0,0 +1,1567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.ContainerRegistriesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryResourceCollection; +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 ContainerRegistriesClient. */ +public final class ContainerRegistriesClientImpl implements ContainerRegistriesClient { + /** The proxy service used to perform REST calls. */ + private final ContainerRegistriesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ContainerRegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerRegistriesClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(ContainerRegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientContainerRegistries to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ContainerRegistriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("containerRegistryName") String containerRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("containerRegistryName") String containerRegistryName, + @BodyParam("application/json") ContainerRegistryResourceInner containerRegistryResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("containerRegistryName") String containerRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("containerRegistryName") String containerRegistryName, + @BodyParam("application/json") ContainerRegistryProperties containerRegistryProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String containerRegistryName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String containerRegistryName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + accept, + context); + } + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String containerRegistryName) { + return getWithResponseAsync(resourceGroupName, serviceName, containerRegistryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String containerRegistryName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, containerRegistryName, context).block(); + } + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerRegistryResourceInner get( + String resourceGroupName, String serviceName, String containerRegistryName) { + return getWithResponse(resourceGroupName, serviceName, containerRegistryName, Context.NONE).getValue(); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + if (containerRegistryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter containerRegistryResource is required and cannot be null.")); + } else { + containerRegistryResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + containerRegistryResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + if (containerRegistryResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter containerRegistryResource is required and cannot be null.")); + } else { + containerRegistryResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + containerRegistryResource, + accept, + context); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerRegistryResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerRegistryResourceInner.class, + ContainerRegistryResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerRegistryResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerRegistryResourceInner.class, + ContainerRegistryResourceInner.class, + context); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, containerRegistryName, containerRegistryResource) + .getSyncPoller(); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, context) + .getSyncPoller(); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerRegistryResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, containerRegistryName, containerRegistryResource) + .block(); + } + + /** + * Create or update container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container registry resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerRegistryResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryResourceInner containerRegistryResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, context) + .block(); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String containerRegistryName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String containerRegistryName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + accept, + context); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String containerRegistryName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, containerRegistryName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String containerRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, containerRegistryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String containerRegistryName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, containerRegistryName).getSyncPoller(); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String containerRegistryName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, containerRegistryName, context).getSyncPoller(); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String containerRegistryName) { + return beginDeleteAsync(resourceGroupName, serviceName, containerRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String containerRegistryName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, containerRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String containerRegistryName) { + deleteAsync(resourceGroupName, serviceName, containerRegistryName).block(); + } + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String containerRegistryName, Context context) { + deleteAsync(resourceGroupName, serviceName, containerRegistryName, context).block(); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + if (containerRegistryProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter containerRegistryProperties is required and cannot be null.")); + } else { + containerRegistryProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + containerRegistryProperties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (containerRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerRegistryName is required and cannot be null.")); + } + if (containerRegistryProperties == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter containerRegistryProperties is required and cannot be null.")); + } else { + containerRegistryProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + containerRegistryName, + containerRegistryProperties, + accept, + context); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerRegistryValidateResultInner> + beginValidateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties) { + Mono>> mono = + validateWithResponseAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerRegistryValidateResultInner.class, + ContainerRegistryValidateResultInner.class, + this.client.getContext()); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerRegistryValidateResultInner> + beginValidateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + validateWithResponseAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerRegistryValidateResultInner.class, + ContainerRegistryValidateResultInner.class, + context); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerRegistryValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties) { + return this + .beginValidateAsync(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties) + .getSyncPoller(); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerRegistryValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context) { + return this + .beginValidateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, context) + .getSyncPoller(); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties) { + return beginValidateAsync(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context) { + return beginValidateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerRegistryValidateResultInner validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties) { + return validateAsync(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties) + .block(); + } + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerRegistryValidateResultInner validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context) { + return validateAsync( + resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 collection compose of container registry resources list and a possible link for next page along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistriesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistriesImpl.java new file mode 100644 index 0000000000000..28d38094701cb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistriesImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ContainerRegistriesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistries; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryResource; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryValidateResult; + +public final class ContainerRegistriesImpl implements ContainerRegistries { + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistriesImpl.class); + + private final ContainerRegistriesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ContainerRegistriesImpl( + ContainerRegistriesClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ContainerRegistryResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ContainerRegistryResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String containerRegistryName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, containerRegistryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerRegistryResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ContainerRegistryResource get(String resourceGroupName, String serviceName, String containerRegistryName) { + ContainerRegistryResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, containerRegistryName); + if (inner != null) { + return new ContainerRegistryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String containerRegistryName) { + this.serviceClient().delete(resourceGroupName, serviceName, containerRegistryName); + } + + public void delete(String resourceGroupName, String serviceName, String containerRegistryName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, containerRegistryName, context); + } + + public ContainerRegistryValidateResult validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties) { + ContainerRegistryValidateResultInner inner = + this + .serviceClient() + .validate(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties); + if (inner != null) { + return new ContainerRegistryValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerRegistryValidateResult validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context) { + ContainerRegistryValidateResultInner inner = + this + .serviceClient() + .validate(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, context); + if (inner != null) { + return new ContainerRegistryValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerRegistryResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String containerRegistryName = Utils.getValueFromIdByName(id, "containerRegistries"); + if (containerRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerRegistries'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, containerRegistryName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String containerRegistryName = Utils.getValueFromIdByName(id, "containerRegistries"); + if (containerRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerRegistries'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, containerRegistryName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String containerRegistryName = Utils.getValueFromIdByName(id, "containerRegistries"); + if (containerRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerRegistries'.", id))); + } + this.delete(resourceGroupName, serviceName, containerRegistryName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String containerRegistryName = Utils.getValueFromIdByName(id, "containerRegistries"); + if (containerRegistryName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'containerRegistries'.", id))); + } + this.delete(resourceGroupName, serviceName, containerRegistryName, context); + } + + private ContainerRegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ContainerRegistryResourceImpl define(String name) { + return new ContainerRegistryResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistryResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistryResourceImpl.java new file mode 100644 index 0000000000000..90d10b535b9ba --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistryResourceImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryResource; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryValidateResult; + +public final class ContainerRegistryResourceImpl + implements ContainerRegistryResource, ContainerRegistryResource.Definition, ContainerRegistryResource.Update { + private ContainerRegistryResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ContainerRegistryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ContainerRegistryResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String containerRegistryName; + + public ContainerRegistryResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public ContainerRegistryResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerRegistries() + .createOrUpdate(resourceGroupName, serviceName, containerRegistryName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerRegistryResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerRegistries() + .createOrUpdate(resourceGroupName, serviceName, containerRegistryName, this.innerModel(), context); + return this; + } + + ContainerRegistryResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ContainerRegistryResourceInner(); + this.serviceManager = serviceManager; + this.containerRegistryName = name; + } + + public ContainerRegistryResourceImpl update() { + return this; + } + + public ContainerRegistryResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerRegistries() + .createOrUpdate(resourceGroupName, serviceName, containerRegistryName, this.innerModel(), Context.NONE); + return this; + } + + public ContainerRegistryResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerRegistries() + .createOrUpdate(resourceGroupName, serviceName, containerRegistryName, this.innerModel(), context); + return this; + } + + ContainerRegistryResourceImpl( + ContainerRegistryResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.containerRegistryName = Utils.getValueFromIdByName(innerObject.id(), "containerRegistries"); + } + + public ContainerRegistryResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerRegistries() + .getWithResponse(resourceGroupName, serviceName, containerRegistryName, Context.NONE) + .getValue(); + return this; + } + + public ContainerRegistryResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerRegistries() + .getWithResponse(resourceGroupName, serviceName, containerRegistryName, context) + .getValue(); + return this; + } + + public ContainerRegistryValidateResult validate(ContainerRegistryProperties containerRegistryProperties) { + return serviceManager + .containerRegistries() + .validate(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties); + } + + public ContainerRegistryValidateResult validate( + ContainerRegistryProperties containerRegistryProperties, Context context) { + return serviceManager + .containerRegistries() + .validate(resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, context); + } + + public ContainerRegistryResourceImpl withProperties(ContainerRegistryProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistryValidateResultImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistryValidateResultImpl.java new file mode 100644 index 0000000000000..1335ea3e1c1f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ContainerRegistryValidateResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryValidateResult; + +public final class ContainerRegistryValidateResultImpl implements ContainerRegistryValidateResult { + private ContainerRegistryValidateResultInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ContainerRegistryValidateResultImpl( + ContainerRegistryValidateResultInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isValid() { + return this.innerModel().isValid(); + } + + public String message() { + return this.innerModel().message(); + } + + public ContainerRegistryValidateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainResourceImpl.java new file mode 100644 index 0000000000000..b156efe8f6244 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainResourceImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainResource; + +public final class CustomDomainResourceImpl + implements CustomDomainResource, CustomDomainResource.Definition, CustomDomainResource.Update { + private CustomDomainResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CustomDomainProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CustomDomainResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String appName; + + private String domainName; + + public CustomDomainResourceImpl withExistingApp(String resourceGroupName, String serviceName, String appName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.appName = appName; + return this; + } + + public CustomDomainResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .createOrUpdate(resourceGroupName, serviceName, appName, domainName, this.innerModel(), Context.NONE); + return this; + } + + public CustomDomainResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .createOrUpdate(resourceGroupName, serviceName, appName, domainName, this.innerModel(), context); + return this; + } + + CustomDomainResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new CustomDomainResourceInner(); + this.serviceManager = serviceManager; + this.domainName = name; + } + + public CustomDomainResourceImpl update() { + return this; + } + + public CustomDomainResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .update(resourceGroupName, serviceName, appName, domainName, this.innerModel(), Context.NONE); + return this; + } + + public CustomDomainResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .update(resourceGroupName, serviceName, appName, domainName, this.innerModel(), context); + return this; + } + + CustomDomainResourceImpl( + CustomDomainResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.appName = Utils.getValueFromIdByName(innerObject.id(), "apps"); + this.domainName = Utils.getValueFromIdByName(innerObject.id(), "domains"); + } + + public CustomDomainResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .getWithResponse(resourceGroupName, serviceName, appName, domainName, Context.NONE) + .getValue(); + return this; + } + + public CustomDomainResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomDomains() + .getWithResponse(resourceGroupName, serviceName, appName, domainName, context) + .getValue(); + return this; + } + + public CustomDomainResourceImpl withProperties(CustomDomainProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainValidateResultImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainValidateResultImpl.java new file mode 100644 index 0000000000000..e189f3421ea72 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainValidateResultImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; + +public final class CustomDomainValidateResultImpl implements CustomDomainValidateResult { + private CustomDomainValidateResultInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + CustomDomainValidateResultImpl( + CustomDomainValidateResultInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean isValid() { + return this.innerModel().isValid(); + } + + public String message() { + return this.innerModel().message(); + } + + public CustomDomainValidateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsClientImpl.java new file mode 100644 index 0000000000000..98eb762714854 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsClientImpl.java @@ -0,0 +1,1634 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.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.appplatform.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainResourceCollection; +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 CustomDomainsClient. */ +public final class CustomDomainsClientImpl implements CustomDomainsClient { + /** The proxy service used to perform REST calls. */ + private final CustomDomainsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of CustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomDomainsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(CustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCustomDomains to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface CustomDomainsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") CustomDomainResourceInner domainResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") CustomDomainResourceInner domainResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + accept, + context); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, domainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, domainName, context).block(); + } + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner get( + String resourceGroupName, String serviceName, String appName, String domainName) { + return getWithResponse(resourceGroupName, serviceName, appName, domainName, Context.NONE).getValue(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (domainResource == null) { + return Mono.error(new IllegalArgumentException("Parameter domainResource is required and cannot be null.")); + } else { + domainResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (domainResource == null) { + return Mono.error(new IllegalArgumentException("Parameter domainResource is required and cannot be null.")); + } else { + domainResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + accept, + context); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, domainResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainResourceInner.class, + CustomDomainResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, domainName, domainResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainResourceInner.class, + CustomDomainResourceInner.class, + context); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource) + .getSyncPoller(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context) + .getSyncPoller(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource).block(); + } + + /** + * Create or update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context) + .block(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + accept, + context); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, String domainName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, domainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, domainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String domainName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, domainName).getSyncPoller(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, domainName, context).getSyncPoller(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String appName, String domainName) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, domainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, domainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, String domainName) { + deleteAsync(resourceGroupName, serviceName, appName, domainName).block(); + } + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, domainName, context).block(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (domainResource == null) { + return Mono.error(new IllegalArgumentException("Parameter domainResource is required and cannot be null.")); + } else { + domainResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (domainResource == null) { + return Mono.error(new IllegalArgumentException("Parameter domainResource is required and cannot be null.")); + } else { + domainResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + domainName, + domainResource, + accept, + context); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, domainResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainResourceInner.class, + CustomDomainResourceInner.class, + this.client.getContext()); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomDomainResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomDomainResourceInner.class, + CustomDomainResourceInner.class, + context); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return this + .beginUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource) + .getSyncPoller(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context) + .getSyncPoller(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return updateAsync(resourceGroupName, serviceName, appName, domainName, domainResource).block(); + } + + /** + * Update custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param domainResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, domainName, domainResource, context).block(); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName)); + } + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, 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 collection compose of a custom domain resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 collection compose of a custom domain resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsImpl.java new file mode 100644 index 0000000000000..aada00b0f1922 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsImpl.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.CustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainResource; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomains; + +public final class CustomDomainsImpl implements CustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainsImpl.class); + + private final CustomDomainsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public CustomDomainsImpl( + CustomDomainsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, appName, domainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomDomainResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomDomainResource get(String resourceGroupName, String serviceName, String appName, String domainName) { + CustomDomainResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, appName, domainName); + if (inner != null) { + return new CustomDomainResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String appName, String domainName) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, domainName); + } + + public void delete( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, domainName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, appName); + return Utils.mapPage(inner, inner1 -> new CustomDomainResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, appName, context); + return Utils.mapPage(inner, inner1 -> new CustomDomainResourceImpl(inner1, this.manager())); + } + + public CustomDomainResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, domainName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, domainName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, domainName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, domainName, context); + } + + private CustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public CustomDomainResourceImpl define(String name) { + return new CustomDomainResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorResourceImpl.java new file mode 100644 index 0000000000000..89e57fe612578 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorResourceImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorResource; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +public final class CustomizedAcceleratorResourceImpl + implements CustomizedAcceleratorResource, + CustomizedAcceleratorResource.Definition, + CustomizedAcceleratorResource.Update { + private CustomizedAcceleratorResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CustomizedAcceleratorProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CustomizedAcceleratorResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String applicationAcceleratorName; + + private String customizedAcceleratorName; + + public CustomizedAcceleratorResourceImpl withExistingApplicationAccelerator( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.applicationAcceleratorName = applicationAcceleratorName; + return this; + } + + public CustomizedAcceleratorResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomizedAccelerators() + .createOrUpdate( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + this.innerModel(), + Context.NONE); + return this; + } + + public CustomizedAcceleratorResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomizedAccelerators() + .createOrUpdate( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + this.innerModel(), + context); + return this; + } + + CustomizedAcceleratorResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new CustomizedAcceleratorResourceInner(); + this.serviceManager = serviceManager; + this.customizedAcceleratorName = name; + } + + public CustomizedAcceleratorResourceImpl update() { + return this; + } + + public CustomizedAcceleratorResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomizedAccelerators() + .createOrUpdate( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + this.innerModel(), + Context.NONE); + return this; + } + + public CustomizedAcceleratorResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomizedAccelerators() + .createOrUpdate( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + this.innerModel(), + context); + return this; + } + + CustomizedAcceleratorResourceImpl( + CustomizedAcceleratorResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.applicationAcceleratorName = Utils.getValueFromIdByName(innerObject.id(), "applicationAccelerators"); + this.customizedAcceleratorName = Utils.getValueFromIdByName(innerObject.id(), "customizedAccelerators"); + } + + public CustomizedAcceleratorResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getCustomizedAccelerators() + .getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, Context.NONE) + .getValue(); + return this; + } + + public CustomizedAcceleratorResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getCustomizedAccelerators() + .getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context) + .getValue(); + return this; + } + + public Response validateWithResponse( + CustomizedAcceleratorProperties properties, Context context) { + return serviceManager + .customizedAccelerators() + .validateWithResponse( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + properties, + context); + } + + public CustomizedAcceleratorValidateResult validate(CustomizedAcceleratorProperties properties) { + return serviceManager + .customizedAccelerators() + .validate( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, properties); + } + + public CustomizedAcceleratorResourceImpl withProperties(CustomizedAcceleratorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public CustomizedAcceleratorResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorValidateResultImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorValidateResultImpl.java new file mode 100644 index 0000000000000..97fae50d9dbcd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorValidateResultImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorValidateResultState; + +public final class CustomizedAcceleratorValidateResultImpl implements CustomizedAcceleratorValidateResult { + private CustomizedAcceleratorValidateResultInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + CustomizedAcceleratorValidateResultImpl( + CustomizedAcceleratorValidateResultInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public CustomizedAcceleratorValidateResultState state() { + return this.innerModel().state(); + } + + public String errorMessage() { + return this.innerModel().errorMessage(); + } + + public CustomizedAcceleratorValidateResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorsClientImpl.java new file mode 100644 index 0000000000000..28a1b4d9e90c8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorsClientImpl.java @@ -0,0 +1,1670 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.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.appplatform.generated.fluent.CustomizedAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorResourceCollection; +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 CustomizedAcceleratorsClient. */ +public final class CustomizedAcceleratorsClientImpl implements CustomizedAcceleratorsClient { + /** The proxy service used to perform REST calls. */ + private final CustomizedAcceleratorsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of CustomizedAcceleratorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CustomizedAcceleratorsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(CustomizedAcceleratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientCustomizedAccelerators to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface CustomizedAcceleratorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("customizedAcceleratorName") String customizedAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("customizedAcceleratorName") String customizedAcceleratorName, + @BodyParam("application/json") CustomizedAcceleratorResourceInner customizedAcceleratorResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("customizedAcceleratorName") String customizedAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/validate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("customizedAcceleratorName") String customizedAcceleratorName, + @BodyParam("application/json") CustomizedAcceleratorProperties properties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + 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())); + } + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, applicationAcceleratorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, applicationAcceleratorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, applicationAcceleratorName)); + } + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, applicationAcceleratorName, context)); + } + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + accept, + context); + } + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + return getWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + return getWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context) + .block(); + } + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomizedAcceleratorResourceInner get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + return getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, Context.NONE) + .getValue(); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorResource is required and cannot be null.")); + } else { + customizedAcceleratorResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorResource is required and cannot be null.")); + } else { + customizedAcceleratorResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource, + accept, + context); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomizedAcceleratorResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomizedAcceleratorResourceInner.class, + CustomizedAcceleratorResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CustomizedAcceleratorResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + CustomizedAcceleratorResourceInner.class, + CustomizedAcceleratorResourceInner.class, + context); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomizedAcceleratorResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource) + .getSyncPoller(); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomizedAcceleratorResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource, + context) + .getSyncPoller(); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomizedAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource) { + return createOrUpdateAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource) + .block(); + } + + /** + * Create or update the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param customizedAcceleratorResource The customized accelerator for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return customized accelerator resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomizedAcceleratorResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorResourceInner customizedAcceleratorResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + customizedAcceleratorResource, + context) + .block(); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + accept, + context); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + return this + .beginDeleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName) + .getSyncPoller(); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + return this + .beginDeleteAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context) + .getSyncPoller(); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + return beginDeleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + return beginDeleteAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + deleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName).block(); + } + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + deleteAsync(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context) + .block(); + } + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (customizedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter customizedAcceleratorName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + properties, + accept, + context); + } + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties) { + return validateWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties, + Context context) { + return validateWithResponseAsync( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + properties, + context) + .block(); + } + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomizedAcceleratorValidateResultInner validate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties) { + return validateWithResponse( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + properties, + 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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorsImpl.java new file mode 100644 index 0000000000000..e7dc87e348c34 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomizedAcceleratorsImpl.java @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.CustomizedAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorResource; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAccelerators; + +public final class CustomizedAcceleratorsImpl implements CustomizedAccelerators { + private static final ClientLogger LOGGER = new ClientLogger(CustomizedAcceleratorsImpl.class); + + private final CustomizedAcceleratorsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public CustomizedAcceleratorsImpl( + CustomizedAcceleratorsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, applicationAcceleratorName); + return Utils.mapPage(inner, inner1 -> new CustomizedAcceleratorResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, applicationAcceleratorName, context); + return Utils.mapPage(inner, inner1 -> new CustomizedAcceleratorResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomizedAcceleratorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomizedAcceleratorResource get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + CustomizedAcceleratorResourceInner inner = + this + .serviceClient() + .get(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName); + if (inner != null) { + return new CustomizedAcceleratorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName) { + this + .serviceClient() + .delete(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName); + } + + public void delete( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context); + } + + public Response validateWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties, + Context context) { + Response inner = + this + .serviceClient() + .validateWithResponse( + resourceGroupName, + serviceName, + applicationAcceleratorName, + customizedAcceleratorName, + properties, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomizedAcceleratorValidateResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomizedAcceleratorValidateResult validate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties) { + CustomizedAcceleratorValidateResultInner inner = + this + .serviceClient() + .validate( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, properties); + if (inner != null) { + return new CustomizedAcceleratorValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public CustomizedAcceleratorResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + String customizedAcceleratorName = Utils.getValueFromIdByName(id, "customizedAccelerators"); + if (customizedAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customizedAccelerators'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + String customizedAcceleratorName = Utils.getValueFromIdByName(id, "customizedAccelerators"); + if (customizedAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customizedAccelerators'.", + id))); + } + return this + .getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + String customizedAcceleratorName = Utils.getValueFromIdByName(id, "customizedAccelerators"); + if (customizedAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customizedAccelerators'.", + id))); + } + this + .delete( + resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String applicationAcceleratorName = Utils.getValueFromIdByName(id, "applicationAccelerators"); + if (applicationAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationAccelerators'.", + id))); + } + String customizedAcceleratorName = Utils.getValueFromIdByName(id, "customizedAccelerators"); + if (customizedAcceleratorName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'customizedAccelerators'.", + id))); + } + this.delete(resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, context); + } + + private CustomizedAcceleratorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public CustomizedAcceleratorResourceImpl define(String name) { + return new CustomizedAcceleratorResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentListImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentListImpl.java new file mode 100644 index 0000000000000..10872ca2d7bad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentListImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentListInner; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentList; +import java.util.Collections; +import java.util.List; + +public final class DeploymentListImpl implements DeploymentList { + private DeploymentListInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + DeploymentListImpl( + DeploymentListInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List deployments() { + List inner = this.innerModel().deployments(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public DeploymentListInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentResourceImpl.java new file mode 100644 index 0000000000000..6f1fb97ff30de --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentResourceImpl.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResource; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; +import com.azure.resourcemanager.appplatform.generated.models.LogFileUrlResponse; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebugging; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebuggingPayload; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +public final class DeploymentResourceImpl + implements DeploymentResource, DeploymentResource.Definition, DeploymentResource.Update { + private DeploymentResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DeploymentResourceProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DeploymentResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String appName; + + private String deploymentName; + + public DeploymentResourceImpl withExistingApp(String resourceGroupName, String serviceName, String appName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.appName = appName; + return this; + } + + public DeploymentResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .createOrUpdate( + resourceGroupName, serviceName, appName, deploymentName, this.innerModel(), Context.NONE); + return this; + } + + public DeploymentResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .createOrUpdate(resourceGroupName, serviceName, appName, deploymentName, this.innerModel(), context); + return this; + } + + DeploymentResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new DeploymentResourceInner(); + this.serviceManager = serviceManager; + this.deploymentName = name; + } + + public DeploymentResourceImpl update() { + return this; + } + + public DeploymentResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .update(resourceGroupName, serviceName, appName, deploymentName, this.innerModel(), Context.NONE); + return this; + } + + public DeploymentResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .update(resourceGroupName, serviceName, appName, deploymentName, this.innerModel(), context); + return this; + } + + DeploymentResourceImpl( + DeploymentResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.appName = Utils.getValueFromIdByName(innerObject.id(), "apps"); + this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "deployments"); + } + + public DeploymentResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .getWithResponse(resourceGroupName, serviceName, appName, deploymentName, Context.NONE) + .getValue(); + return this; + } + + public DeploymentResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDeployments() + .getWithResponse(resourceGroupName, serviceName, appName, deploymentName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.deployments().start(resourceGroupName, serviceName, appName, deploymentName); + } + + public void start(Context context) { + serviceManager.deployments().start(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public void stop() { + serviceManager.deployments().stop(resourceGroupName, serviceName, appName, deploymentName); + } + + public void stop(Context context) { + serviceManager.deployments().stop(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public void restart() { + serviceManager.deployments().restart(resourceGroupName, serviceName, appName, deploymentName); + } + + public void restart(Context context) { + serviceManager.deployments().restart(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public RemoteDebugging enableRemoteDebugging() { + return serviceManager + .deployments() + .enableRemoteDebugging(resourceGroupName, serviceName, appName, deploymentName); + } + + public RemoteDebugging enableRemoteDebugging(RemoteDebuggingPayload remoteDebuggingPayload, Context context) { + return serviceManager + .deployments() + .enableRemoteDebugging( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload, context); + } + + public RemoteDebugging disableRemoteDebugging() { + return serviceManager + .deployments() + .disableRemoteDebugging(resourceGroupName, serviceName, appName, deploymentName); + } + + public RemoteDebugging disableRemoteDebugging(Context context) { + return serviceManager + .deployments() + .disableRemoteDebugging(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public Response getRemoteDebuggingConfigWithResponse(Context context) { + return serviceManager + .deployments() + .getRemoteDebuggingConfigWithResponse(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public RemoteDebugging getRemoteDebuggingConfig() { + return serviceManager + .deployments() + .getRemoteDebuggingConfig(resourceGroupName, serviceName, appName, deploymentName); + } + + public Response getLogFileUrlWithResponse(Context context) { + return serviceManager + .deployments() + .getLogFileUrlWithResponse(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public LogFileUrlResponse getLogFileUrl() { + return serviceManager.deployments().getLogFileUrl(resourceGroupName, serviceName, appName, deploymentName); + } + + public void generateHeapDump(DiagnosticParameters diagnosticParameters) { + serviceManager + .deployments() + .generateHeapDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + } + + public void generateHeapDump(DiagnosticParameters diagnosticParameters, Context context) { + serviceManager + .deployments() + .generateHeapDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + } + + public void generateThreadDump(DiagnosticParameters diagnosticParameters) { + serviceManager + .deployments() + .generateThreadDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + } + + public void generateThreadDump(DiagnosticParameters diagnosticParameters, Context context) { + serviceManager + .deployments() + .generateThreadDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + } + + public void startJfr(DiagnosticParameters diagnosticParameters) { + serviceManager + .deployments() + .startJfr(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + } + + public void startJfr(DiagnosticParameters diagnosticParameters, Context context) { + serviceManager + .deployments() + .startJfr(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + } + + public DeploymentResourceImpl withProperties(DeploymentResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public DeploymentResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsClientImpl.java new file mode 100644 index 0000000000000..2d6cd9f12507a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsClientImpl.java @@ -0,0 +1,5212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.RemoteDebuggingInner; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebuggingPayload; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +public final class DeploymentsClientImpl implements DeploymentsClient { + /** The proxy service used to perform REST calls. */ + private final DeploymentsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of DeploymentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeploymentsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientDeployments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface DeploymentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DeploymentResourceInner deploymentResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DeploymentResourceInner deploymentResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @QueryParam(value = "version", multipleQueryParams = true) List version, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForCluster( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @QueryParam(value = "version", multipleQueryParams = true) List version, + @QueryParam("$expand") String expand, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableRemoteDebugging( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") RemoteDebuggingPayload remoteDebuggingPayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableRemoteDebugging( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getRemoteDebuggingConfig( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLogFileUrl( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateHeapDump") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateHeapDump( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DiagnosticParameters diagnosticParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/generateThreadDump") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generateThreadDump( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DiagnosticParameters diagnosticParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/startJFR") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startJfr( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, + @BodyParam("application/json") DiagnosticParameters diagnosticParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listForClusterNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner get( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getWithResponse(resourceGroupName, serviceName, appName, deploymentName, Context.NONE).getValue(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (deploymentResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentResource is required and cannot be null.")); + } else { + deploymentResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (deploymentResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentResource is required and cannot be null.")); + } else { + deploymentResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + accept, + context); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, deploymentResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentResourceInner.class, + DeploymentResourceInner.class, + this.client.getContext()); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentResourceInner.class, + DeploymentResourceInner.class, + context); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource) + .getSyncPoller(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context) + .getSyncPoller(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).block(); + } + + /** + * Create a new Deployment or update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context) + .block(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String appName, String deploymentName) { + deleteAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + deleteAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (deploymentResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentResource is required and cannot be null.")); + } else { + deploymentResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (deploymentResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter deploymentResource is required and cannot be null.")); + } else { + deploymentResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + deploymentResource, + accept, + context); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentResourceInner.class, + DeploymentResourceInner.class, + this.client.getContext()); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DeploymentResourceInner> beginUpdateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DeploymentResourceInner.class, + DeploymentResourceInner.class, + context); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return this + .beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return this + .beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return updateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource).block(); + } + + /** + * Operation to update an exiting Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param deploymentResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentResourceInner update( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return updateAsync(resourceGroupName, serviceName, appName, deploymentName, deploymentResource, context) + .block(); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String appName, List version, String expand) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + List versionConverted = + (version == null) + ? new ArrayList<>() + : version.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + versionConverted, + expand, + 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())); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String serviceName, + String appName, + List version, + String expand, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + final String accept = "application/json"; + List versionConverted = + (version == null) + ? new ArrayList<>() + : version.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + versionConverted, + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version, String expand) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + final List version = null; + final String expand = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version, expand), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String serviceName, + String appName, + List version, + String expand, + Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version, expand, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + final List version = null; + final String expand = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version, expand)); + } + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String serviceName, + String appName, + List version, + String expand, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version, expand, context)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterSinglePageAsync( + String resourceGroupName, String serviceName, List version, String expand) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + List versionConverted = + (version == null) + ? new ArrayList<>() + : version.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext( + context -> + service + .listForCluster( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + versionConverted, + expand, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterSinglePageAsync( + String resourceGroupName, String serviceName, List version, String expand, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + List versionConverted = + (version == null) + ? new ArrayList<>() + : version.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + context = this.client.mergeContext(context); + return service + .listForCluster( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + versionConverted, + expand, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync( + String resourceGroupName, String serviceName, List version, String expand) { + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, version, expand), + nextLink -> listForClusterNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync(String resourceGroupName, String serviceName) { + final List version = null; + final String expand = null; + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, version, expand), + nextLink -> listForClusterNextSinglePageAsync(nextLink)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync( + String resourceGroupName, String serviceName, List version, String expand, Context context) { + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, version, expand, context), + nextLink -> listForClusterNextSinglePageAsync(nextLink, context)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForCluster(String resourceGroupName, String serviceName) { + final List version = null; + final String expand = null; + return new PagedIterable<>(listForClusterAsync(resourceGroupName, serviceName, version, expand)); + } + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, String expand, Context context) { + return new PagedIterable<>(listForClusterAsync(resourceGroupName, serviceName, version, expand, context)); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return this.beginStartAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return this.beginStartAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStartAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String serviceName, String appName, String deploymentName) { + startAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + startAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return this.beginStopAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return this.beginStopAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginStopAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String serviceName, String appName, String deploymentName) { + stopAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + stopAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return this.beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName).getSyncPoller(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return this.beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName, context).getSyncPoller(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginRestartAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + restartAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + restartAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableRemoteDebuggingWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (remoteDebuggingPayload != null) { + remoteDebuggingPayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableRemoteDebugging( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + remoteDebuggingPayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableRemoteDebuggingWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (remoteDebuggingPayload != null) { + remoteDebuggingPayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableRemoteDebugging( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + remoteDebuggingPayload, + accept, + context); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RemoteDebuggingInner> beginEnableRemoteDebuggingAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload) { + Mono>> mono = + enableRemoteDebuggingWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RemoteDebuggingInner.class, + RemoteDebuggingInner.class, + this.client.getContext()); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RemoteDebuggingInner> beginEnableRemoteDebuggingAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + final RemoteDebuggingPayload remoteDebuggingPayload = null; + Mono>> mono = + enableRemoteDebuggingWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RemoteDebuggingInner.class, + RemoteDebuggingInner.class, + this.client.getContext()); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RemoteDebuggingInner> beginEnableRemoteDebuggingAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableRemoteDebuggingWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RemoteDebuggingInner.class, RemoteDebuggingInner.class, context); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RemoteDebuggingInner> beginEnableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + final RemoteDebuggingPayload remoteDebuggingPayload = null; + return this + .beginEnableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload) + .getSyncPoller(); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RemoteDebuggingInner> beginEnableRemoteDebugging( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context) { + return this + .beginEnableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload, context) + .getSyncPoller(); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableRemoteDebuggingAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload) { + return beginEnableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableRemoteDebuggingAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + final RemoteDebuggingPayload remoteDebuggingPayload = null; + return beginEnableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableRemoteDebuggingAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context) { + return beginEnableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RemoteDebuggingInner enableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + final RemoteDebuggingPayload remoteDebuggingPayload = null; + return enableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload) + .block(); + } + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RemoteDebuggingInner enableRemoteDebugging( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context) { + return enableRemoteDebuggingAsync( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload, context) + .block(); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableRemoteDebuggingWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableRemoteDebugging( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableRemoteDebuggingWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableRemoteDebugging( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RemoteDebuggingInner> beginDisableRemoteDebuggingAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + Mono>> mono = + disableRemoteDebuggingWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + RemoteDebuggingInner.class, + RemoteDebuggingInner.class, + this.client.getContext()); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RemoteDebuggingInner> beginDisableRemoteDebuggingAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableRemoteDebuggingWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RemoteDebuggingInner.class, RemoteDebuggingInner.class, context); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RemoteDebuggingInner> beginDisableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return this + .beginDisableRemoteDebuggingAsync(resourceGroupName, serviceName, appName, deploymentName) + .getSyncPoller(); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of remote debugging config. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RemoteDebuggingInner> beginDisableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return this + .beginDisableRemoteDebuggingAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .getSyncPoller(); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableRemoteDebuggingAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return beginDisableRemoteDebuggingAsync(resourceGroupName, serviceName, appName, deploymentName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableRemoteDebuggingAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return beginDisableRemoteDebuggingAsync(resourceGroupName, serviceName, appName, deploymentName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RemoteDebuggingInner disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return disableRemoteDebuggingAsync(resourceGroupName, serviceName, appName, deploymentName).block(); + } + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RemoteDebuggingInner disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return disableRemoteDebuggingAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRemoteDebuggingConfigWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getRemoteDebuggingConfig( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRemoteDebuggingConfigWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getRemoteDebuggingConfig( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRemoteDebuggingConfigAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getRemoteDebuggingConfigWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRemoteDebuggingConfigWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getRemoteDebuggingConfigWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, context) + .block(); + } + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RemoteDebuggingInner getRemoteDebuggingConfig( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getRemoteDebuggingConfigWithResponse( + resourceGroupName, serviceName, appName, deploymentName, Context.NONE) + .getValue(); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogFileUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLogFileUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLogFileUrlWithResponseAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLogFileUrl( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + accept, + context); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLogFileUrlAsync( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogFileUrlWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return getLogFileUrlWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, context).block(); + } + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LogFileUrlResponseInner getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return getLogFileUrlWithResponse(resourceGroupName, serviceName, appName, deploymentName, Context.NONE) + .getValue(); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> generateHeapDumpWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (diagnosticParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter diagnosticParameters is required and cannot be null.")); + } else { + diagnosticParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateHeapDump( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateHeapDumpWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (diagnosticParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter diagnosticParameters is required and cannot be null.")); + } else { + diagnosticParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateHeapDump( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters, + accept, + context); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginGenerateHeapDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + Mono>> mono = + generateHeapDumpWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGenerateHeapDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateHeapDumpWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginGenerateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return this + .beginGenerateHeapDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters) + .getSyncPoller(); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return this + .beginGenerateHeapDumpAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .getSyncPoller(); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 generateHeapDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return beginGenerateHeapDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateHeapDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return beginGenerateHeapDumpAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + generateHeapDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters).block(); + } + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + generateHeapDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .block(); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> generateThreadDumpWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (diagnosticParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter diagnosticParameters is required and cannot be null.")); + } else { + diagnosticParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .generateThreadDump( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateThreadDumpWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (diagnosticParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter diagnosticParameters is required and cannot be null.")); + } else { + diagnosticParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .generateThreadDump( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters, + accept, + context); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginGenerateThreadDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + Mono>> mono = + generateThreadDumpWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGenerateThreadDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + generateThreadDumpWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginGenerateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return this + .beginGenerateThreadDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters) + .getSyncPoller(); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return this + .beginGenerateThreadDumpAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .getSyncPoller(); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 generateThreadDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return beginGenerateThreadDumpAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateThreadDumpAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return beginGenerateThreadDumpAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + generateThreadDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters).block(); + } + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + generateThreadDumpAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .block(); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> startJfrWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (diagnosticParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter diagnosticParameters is required and cannot be null.")); + } else { + diagnosticParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startJfr( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startJfrWithResponseAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (appName == null) { + return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (diagnosticParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter diagnosticParameters is required and cannot be null.")); + } else { + diagnosticParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startJfr( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + appName, + deploymentName, + diagnosticParameters, + accept, + context); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartJfrAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + Mono>> mono = + startJfrWithResponseAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStartJfrAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startJfrWithResponseAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginStartJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return this + .beginStartJfrAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters) + .getSyncPoller(); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return this + .beginStartJfrAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .getSyncPoller(); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 startJfrAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return beginStartJfrAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startJfrAsync( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return beginStartJfrAsync( + resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + startJfrAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters).block(); + } + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + startJfrAsync(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterNextSinglePageAsync(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.listForClusterNext(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 object that includes an array of App resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listForClusterNextSinglePageAsync( + 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 + .listForClusterNext(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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsImpl.java new file mode 100644 index 0000000000000..8f344c389ea3e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsImpl.java @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.DeploymentsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.RemoteDebuggingInner; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResource; +import com.azure.resourcemanager.appplatform.generated.models.Deployments; +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; +import com.azure.resourcemanager.appplatform.generated.models.LogFileUrlResponse; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebugging; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebuggingPayload; +import java.util.List; + +public final class DeploymentsImpl implements Deployments { + private static final ClientLogger LOGGER = new ClientLogger(DeploymentsImpl.class); + + private final DeploymentsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public DeploymentsImpl( + DeploymentsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, appName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DeploymentResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DeploymentResource get(String resourceGroupName, String serviceName, String appName, String deploymentName) { + DeploymentResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, appName, deploymentName); + if (inner != null) { + return new DeploymentResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String appName, String deploymentName) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, deploymentName); + } + + public void delete( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, appName); + return Utils.mapPage(inner, inner1 -> new DeploymentResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String serviceName, + String appName, + List version, + String expand, + Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, appName, version, expand, context); + return Utils.mapPage(inner, inner1 -> new DeploymentResourceImpl(inner1, this.manager())); + } + + public PagedIterable listForCluster(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listForCluster(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new DeploymentResourceImpl(inner1, this.manager())); + } + + public PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, String expand, Context context) { + PagedIterable inner = + this.serviceClient().listForCluster(resourceGroupName, serviceName, version, expand, context); + return Utils.mapPage(inner, inner1 -> new DeploymentResourceImpl(inner1, this.manager())); + } + + public void start(String resourceGroupName, String serviceName, String appName, String deploymentName) { + this.serviceClient().start(resourceGroupName, serviceName, appName, deploymentName); + } + + public void start( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + this.serviceClient().start(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public void stop(String resourceGroupName, String serviceName, String appName, String deploymentName) { + this.serviceClient().stop(resourceGroupName, serviceName, appName, deploymentName); + } + + public void stop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + this.serviceClient().stop(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public void restart(String resourceGroupName, String serviceName, String appName, String deploymentName) { + this.serviceClient().restart(resourceGroupName, serviceName, appName, deploymentName); + } + + public void restart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + this.serviceClient().restart(resourceGroupName, serviceName, appName, deploymentName, context); + } + + public RemoteDebugging enableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + RemoteDebuggingInner inner = + this.serviceClient().enableRemoteDebugging(resourceGroupName, serviceName, appName, deploymentName); + if (inner != null) { + return new RemoteDebuggingImpl(inner, this.manager()); + } else { + return null; + } + } + + public RemoteDebugging enableRemoteDebugging( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context) { + RemoteDebuggingInner inner = + this + .serviceClient() + .enableRemoteDebugging( + resourceGroupName, serviceName, appName, deploymentName, remoteDebuggingPayload, context); + if (inner != null) { + return new RemoteDebuggingImpl(inner, this.manager()); + } else { + return null; + } + } + + public RemoteDebugging disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + RemoteDebuggingInner inner = + this.serviceClient().disableRemoteDebugging(resourceGroupName, serviceName, appName, deploymentName); + if (inner != null) { + return new RemoteDebuggingImpl(inner, this.manager()); + } else { + return null; + } + } + + public RemoteDebugging disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + RemoteDebuggingInner inner = + this + .serviceClient() + .disableRemoteDebugging(resourceGroupName, serviceName, appName, deploymentName, context); + if (inner != null) { + return new RemoteDebuggingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getRemoteDebuggingConfigWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Response inner = + this + .serviceClient() + .getRemoteDebuggingConfigWithResponse(resourceGroupName, serviceName, appName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RemoteDebuggingImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public RemoteDebugging getRemoteDebuggingConfig( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + RemoteDebuggingInner inner = + this.serviceClient().getRemoteDebuggingConfig(resourceGroupName, serviceName, appName, deploymentName); + if (inner != null) { + return new RemoteDebuggingImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getLogFileUrlWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + Response inner = + this + .serviceClient() + .getLogFileUrlWithResponse(resourceGroupName, serviceName, appName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LogFileUrlResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public LogFileUrlResponse getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + LogFileUrlResponseInner inner = + this.serviceClient().getLogFileUrl(resourceGroupName, serviceName, appName, deploymentName); + if (inner != null) { + return new LogFileUrlResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + this + .serviceClient() + .generateHeapDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + } + + public void generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + this + .serviceClient() + .generateHeapDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + } + + public void generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + this + .serviceClient() + .generateThreadDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + } + + public void generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + this + .serviceClient() + .generateThreadDump(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + } + + public void startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + this.serviceClient().startJfr(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters); + } + + public void startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + this + .serviceClient() + .startJfr(resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, context); + } + + public DeploymentResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, deploymentName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, appName, deploymentName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, deploymentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String appName = Utils.getValueFromIdByName(id, "apps"); + if (appName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'apps'.", id))); + } + String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + if (deploymentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + } + this.delete(resourceGroupName, serviceName, appName, deploymentName, context); + } + + private DeploymentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public DeploymentResourceImpl define(String name) { + return new DeploymentResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalResourceImpl.java new file mode 100644 index 0000000000000..79acf23775d6e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DevToolPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalResource; + +public final class DevToolPortalResourceImpl + implements DevToolPortalResource, DevToolPortalResource.Definition, DevToolPortalResource.Update { + private DevToolPortalResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public DevToolPortalProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public DevToolPortalResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String devToolPortalName; + + public DevToolPortalResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public DevToolPortalResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getDevToolPortals() + .createOrUpdate(resourceGroupName, serviceName, devToolPortalName, this.innerModel(), Context.NONE); + return this; + } + + public DevToolPortalResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevToolPortals() + .createOrUpdate(resourceGroupName, serviceName, devToolPortalName, this.innerModel(), context); + return this; + } + + DevToolPortalResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new DevToolPortalResourceInner(); + this.serviceManager = serviceManager; + this.devToolPortalName = name; + } + + public DevToolPortalResourceImpl update() { + return this; + } + + public DevToolPortalResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDevToolPortals() + .createOrUpdate(resourceGroupName, serviceName, devToolPortalName, this.innerModel(), Context.NONE); + return this; + } + + public DevToolPortalResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevToolPortals() + .createOrUpdate(resourceGroupName, serviceName, devToolPortalName, this.innerModel(), context); + return this; + } + + DevToolPortalResourceImpl( + DevToolPortalResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.devToolPortalName = Utils.getValueFromIdByName(innerObject.id(), "DevToolPortals"); + } + + public DevToolPortalResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDevToolPortals() + .getWithResponse(resourceGroupName, serviceName, devToolPortalName, Context.NONE) + .getValue(); + return this; + } + + public DevToolPortalResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDevToolPortals() + .getWithResponse(resourceGroupName, serviceName, devToolPortalName, context) + .getValue(); + return this; + } + + public DevToolPortalResourceImpl withProperties(DevToolPortalProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalsClientImpl.java new file mode 100644 index 0000000000000..4be1c98d59fe1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalsClientImpl.java @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.DevToolPortalsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DevToolPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalResourceCollection; +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 DevToolPortalsClient. */ +public final class DevToolPortalsClientImpl implements DevToolPortalsClient { + /** The proxy service used to perform REST calls. */ + private final DevToolPortalsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of DevToolPortalsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DevToolPortalsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(DevToolPortalsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientDevToolPortals to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface DevToolPortalsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("devToolPortalName") String devToolPortalName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("devToolPortalName") String devToolPortalName, + @BodyParam("application/json") DevToolPortalResourceInner devToolPortalResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("devToolPortalName") String devToolPortalName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String devToolPortalName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (devToolPortalName == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + devToolPortalName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String devToolPortalName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (devToolPortalName == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + devToolPortalName, + accept, + context); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String devToolPortalName) { + return getWithResponseAsync(resourceGroupName, serviceName, devToolPortalName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String devToolPortalName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, devToolPortalName, context).block(); + } + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevToolPortalResourceInner get(String resourceGroupName, String serviceName, String devToolPortalName) { + return getWithResponse(resourceGroupName, serviceName, devToolPortalName, Context.NONE).getValue(); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (devToolPortalName == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalName is required and cannot be null.")); + } + if (devToolPortalResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalResource is required and cannot be null.")); + } else { + devToolPortalResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + devToolPortalName, + devToolPortalResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (devToolPortalName == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalName is required and cannot be null.")); + } + if (devToolPortalResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalResource is required and cannot be null.")); + } else { + devToolPortalResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + devToolPortalName, + devToolPortalResource, + accept, + context); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevToolPortalResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, devToolPortalName, devToolPortalResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DevToolPortalResourceInner.class, + DevToolPortalResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, DevToolPortalResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + DevToolPortalResourceInner.class, + DevToolPortalResourceInner.class, + context); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevToolPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, devToolPortalName, devToolPortalResource) + .getSyncPoller(); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DevToolPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, context) + .getSyncPoller(); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, devToolPortalName, devToolPortalResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevToolPortalResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, devToolPortalName, devToolPortalResource).block(); + } + + /** + * Create the default Dev Tool Portal or update the existing Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param devToolPortalResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dev Tool Portal resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DevToolPortalResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String devToolPortalName, + DevToolPortalResourceInner devToolPortalResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, context) + .block(); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String devToolPortalName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (devToolPortalName == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + devToolPortalName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String devToolPortalName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (devToolPortalName == null) { + return Mono + .error(new IllegalArgumentException("Parameter devToolPortalName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + devToolPortalName, + accept, + context); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String devToolPortalName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, devToolPortalName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String devToolPortalName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, devToolPortalName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String devToolPortalName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, devToolPortalName).getSyncPoller(); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String devToolPortalName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, devToolPortalName, context).getSyncPoller(); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String devToolPortalName) { + return beginDeleteAsync(resourceGroupName, serviceName, devToolPortalName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String devToolPortalName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, devToolPortalName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String devToolPortalName) { + deleteAsync(resourceGroupName, serviceName, devToolPortalName).block(); + } + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String devToolPortalName, Context context) { + deleteAsync(resourceGroupName, serviceName, devToolPortalName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Dev Tool Portal resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalsImpl.java new file mode 100644 index 0000000000000..382614769cf18 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DevToolPortalsImpl.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.appplatform.generated.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.appplatform.generated.fluent.DevToolPortalsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DevToolPortalResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalResource; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortals; + +public final class DevToolPortalsImpl implements DevToolPortals { + private static final ClientLogger LOGGER = new ClientLogger(DevToolPortalsImpl.class); + + private final DevToolPortalsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public DevToolPortalsImpl( + DevToolPortalsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new DevToolPortalResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new DevToolPortalResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String devToolPortalName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, devToolPortalName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DevToolPortalResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DevToolPortalResource get(String resourceGroupName, String serviceName, String devToolPortalName) { + DevToolPortalResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, devToolPortalName); + if (inner != null) { + return new DevToolPortalResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String devToolPortalName) { + this.serviceClient().delete(resourceGroupName, serviceName, devToolPortalName); + } + + public void delete(String resourceGroupName, String serviceName, String devToolPortalName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, devToolPortalName, context); + } + + public DevToolPortalResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String devToolPortalName = Utils.getValueFromIdByName(id, "DevToolPortals"); + if (devToolPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'DevToolPortals'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, devToolPortalName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String devToolPortalName = Utils.getValueFromIdByName(id, "DevToolPortals"); + if (devToolPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'DevToolPortals'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, devToolPortalName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String devToolPortalName = Utils.getValueFromIdByName(id, "DevToolPortals"); + if (devToolPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'DevToolPortals'.", id))); + } + this.delete(resourceGroupName, serviceName, devToolPortalName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String devToolPortalName = Utils.getValueFromIdByName(id, "DevToolPortals"); + if (devToolPortalName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'DevToolPortals'.", id))); + } + this.delete(resourceGroupName, serviceName, devToolPortalName, context); + } + + private DevToolPortalsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public DevToolPortalResourceImpl define(String name) { + return new DevToolPortalResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServerResourceCollectionImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServerResourceCollectionImpl.java new file mode 100644 index 0000000000000..16774c13a3d62 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServerResourceCollectionImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerResource; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerResourceCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class EurekaServerResourceCollectionImpl implements EurekaServerResourceCollection { + private EurekaServerResourceCollectionInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + EurekaServerResourceCollectionImpl( + EurekaServerResourceCollectionInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 EurekaServerResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public EurekaServerResourceCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServerResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServerResourceImpl.java new file mode 100644 index 0000000000000..1be62c5970962 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServerResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerProperties; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerResource; + +public final class EurekaServerResourceImpl implements EurekaServerResource { + private EurekaServerResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + EurekaServerResourceImpl( + EurekaServerResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 EurekaServerProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public EurekaServerResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServersClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServersClientImpl.java new file mode 100644 index 0000000000000..93cf6f78c300c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServersClientImpl.java @@ -0,0 +1,985 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.appplatform.generated.fluent.EurekaServersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +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 EurekaServersClient. */ +public final class EurekaServersClientImpl implements EurekaServersClient { + /** The proxy service used to perform REST calls. */ + private final EurekaServersService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of EurekaServersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + EurekaServersClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(EurekaServersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientEurekaServers to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface EurekaServersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePut( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") EurekaServerResourceInner eurekaServerResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePatch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") EurekaServerResourceInner eurekaServerResource, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String serviceName) { + return listWithResponseAsync(resourceGroupName, serviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EurekaServerResourceCollectionInner list(String resourceGroupName, String serviceName) { + return listWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName) { + return getWithResponseAsync(resourceGroupName, serviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EurekaServerResourceInner get(String resourceGroupName, String serviceName) { + return getWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (eurekaServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter eurekaServerResource is required and cannot be null.")); + } else { + eurekaServerResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + eurekaServerResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (eurekaServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter eurekaServerResource is required and cannot be null.")); + } else { + eurekaServerResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + eurekaServerResource, + accept, + context); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EurekaServerResourceInner> beginUpdatePutAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + Mono>> mono = + updatePutWithResponseAsync(resourceGroupName, serviceName, eurekaServerResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EurekaServerResourceInner.class, + EurekaServerResourceInner.class, + this.client.getContext()); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EurekaServerResourceInner> beginUpdatePutAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePutWithResponseAsync(resourceGroupName, serviceName, eurekaServerResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EurekaServerResourceInner.class, + EurekaServerResourceInner.class, + context); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EurekaServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + return this.beginUpdatePutAsync(resourceGroupName, serviceName, eurekaServerResource).getSyncPoller(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EurekaServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + return this.beginUpdatePutAsync(resourceGroupName, serviceName, eurekaServerResource, context).getSyncPoller(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + return beginUpdatePutAsync(resourceGroupName, serviceName, eurekaServerResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + return beginUpdatePutAsync(resourceGroupName, serviceName, eurekaServerResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EurekaServerResourceInner updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + return updatePutAsync(resourceGroupName, serviceName, eurekaServerResource).block(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EurekaServerResourceInner updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + return updatePutAsync(resourceGroupName, serviceName, eurekaServerResource, context).block(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePatchWithResponseAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (eurekaServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter eurekaServerResource is required and cannot be null.")); + } else { + eurekaServerResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePatch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + eurekaServerResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePatchWithResponseAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (eurekaServerResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter eurekaServerResource is required and cannot be null.")); + } else { + eurekaServerResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePatch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + eurekaServerResource, + accept, + context); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EurekaServerResourceInner> beginUpdatePatchAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + Mono>> mono = + updatePatchWithResponseAsync(resourceGroupName, serviceName, eurekaServerResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EurekaServerResourceInner.class, + EurekaServerResourceInner.class, + this.client.getContext()); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, EurekaServerResourceInner> beginUpdatePatchAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePatchWithResponseAsync(resourceGroupName, serviceName, eurekaServerResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EurekaServerResourceInner.class, + EurekaServerResourceInner.class, + context); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EurekaServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + return this.beginUpdatePatchAsync(resourceGroupName, serviceName, eurekaServerResource).getSyncPoller(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of eureka server resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, EurekaServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + return this + .beginUpdatePatchAsync(resourceGroupName, serviceName, eurekaServerResource, context) + .getSyncPoller(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePatchAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + return beginUpdatePatchAsync(resourceGroupName, serviceName, eurekaServerResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePatchAsync( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + return beginUpdatePatchAsync(resourceGroupName, serviceName, eurekaServerResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EurekaServerResourceInner updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + return updatePatchAsync(resourceGroupName, serviceName, eurekaServerResource).block(); + } + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EurekaServerResourceInner updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + return updatePatchAsync(resourceGroupName, serviceName, eurekaServerResource, context).block(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServersImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServersImpl.java new file mode 100644 index 0000000000000..525c9d8a6d4a3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/EurekaServersImpl.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.EurekaServersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceCollectionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerResource; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServers; + +public final class EurekaServersImpl implements EurekaServers { + private static final ClientLogger LOGGER = new ClientLogger(EurekaServersImpl.class); + + private final EurekaServersClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public EurekaServersImpl( + EurekaServersClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EurekaServerResourceCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EurekaServerResourceCollection list(String resourceGroupName, String serviceName) { + EurekaServerResourceCollectionInner inner = this.serviceClient().list(resourceGroupName, serviceName); + if (inner != null) { + return new EurekaServerResourceCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EurekaServerResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public EurekaServerResource get(String resourceGroupName, String serviceName) { + EurekaServerResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName); + if (inner != null) { + return new EurekaServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public EurekaServerResource updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + EurekaServerResourceInner inner = + this.serviceClient().updatePut(resourceGroupName, serviceName, eurekaServerResource); + if (inner != null) { + return new EurekaServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public EurekaServerResource updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + EurekaServerResourceInner inner = + this.serviceClient().updatePut(resourceGroupName, serviceName, eurekaServerResource, context); + if (inner != null) { + return new EurekaServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public EurekaServerResource updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource) { + EurekaServerResourceInner inner = + this.serviceClient().updatePatch(resourceGroupName, serviceName, eurekaServerResource); + if (inner != null) { + return new EurekaServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public EurekaServerResource updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context) { + EurekaServerResourceInner inner = + this.serviceClient().updatePatch(resourceGroupName, serviceName, eurekaServerResource, context); + if (inner != null) { + return new EurekaServerResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private EurekaServersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainResourceImpl.java new file mode 100644 index 0000000000000..2cdca093688c8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainResourceImpl.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainResource; + +public final class GatewayCustomDomainResourceImpl + implements GatewayCustomDomainResource, GatewayCustomDomainResource.Definition, GatewayCustomDomainResource.Update { + private GatewayCustomDomainResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GatewayCustomDomainProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public GatewayCustomDomainResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String gatewayName; + + private String domainName; + + public GatewayCustomDomainResourceImpl withExistingGateway( + String resourceGroupName, String serviceName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.gatewayName = gatewayName; + return this; + } + + public GatewayCustomDomainResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCustomDomains() + .createOrUpdate( + resourceGroupName, serviceName, gatewayName, domainName, this.innerModel(), Context.NONE); + return this; + } + + public GatewayCustomDomainResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCustomDomains() + .createOrUpdate(resourceGroupName, serviceName, gatewayName, domainName, this.innerModel(), context); + return this; + } + + GatewayCustomDomainResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new GatewayCustomDomainResourceInner(); + this.serviceManager = serviceManager; + this.domainName = name; + } + + public GatewayCustomDomainResourceImpl update() { + return this; + } + + public GatewayCustomDomainResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCustomDomains() + .createOrUpdate( + resourceGroupName, serviceName, gatewayName, domainName, this.innerModel(), Context.NONE); + return this; + } + + public GatewayCustomDomainResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCustomDomains() + .createOrUpdate(resourceGroupName, serviceName, gatewayName, domainName, this.innerModel(), context); + return this; + } + + GatewayCustomDomainResourceImpl( + GatewayCustomDomainResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "gateways"); + this.domainName = Utils.getValueFromIdByName(innerObject.id(), "domains"); + } + + public GatewayCustomDomainResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCustomDomains() + .getWithResponse(resourceGroupName, serviceName, gatewayName, domainName, Context.NONE) + .getValue(); + return this; + } + + public GatewayCustomDomainResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayCustomDomains() + .getWithResponse(resourceGroupName, serviceName, gatewayName, domainName, context) + .getValue(); + return this; + } + + public GatewayCustomDomainResourceImpl withProperties(GatewayCustomDomainProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsClientImpl.java new file mode 100644 index 0000000000000..c0c24ae8c6cda --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsClientImpl.java @@ -0,0 +1,1273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.GatewayCustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainResourceCollection; +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 GatewayCustomDomainsClient. */ +public final class GatewayCustomDomainsClientImpl implements GatewayCustomDomainsClient { + /** The proxy service used to perform REST calls. */ + private final GatewayCustomDomainsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of GatewayCustomDomainsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewayCustomDomainsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(GatewayCustomDomainsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientGatewayCustomDomains to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface GatewayCustomDomainsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @PathParam("domainName") String domainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @PathParam("domainName") String domainName, + @BodyParam("application/json") GatewayCustomDomainResourceInner gatewayCustomDomainResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @PathParam("domainName") String domainName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, String domainName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + domainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + domainName, + accept, + context); + } + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String gatewayName, String domainName) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayName, domainName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String domainName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayName, domainName, context).block(); + } + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayCustomDomainResourceInner get( + String resourceGroupName, String serviceName, String gatewayName, String domainName) { + return getWithResponse(resourceGroupName, serviceName, gatewayName, domainName, Context.NONE).getValue(); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (gatewayCustomDomainResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter gatewayCustomDomainResource is required and cannot be null.")); + } else { + gatewayCustomDomainResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + if (gatewayCustomDomainResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter gatewayCustomDomainResource is required and cannot be null.")); + } else { + gatewayCustomDomainResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + domainName, + gatewayCustomDomainResource, + accept, + context); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayCustomDomainResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayCustomDomainResourceInner.class, + GatewayCustomDomainResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayCustomDomainResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayCustomDomainResourceInner.class, + GatewayCustomDomainResourceInner.class, + context); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource) + .getSyncPoller(); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, context) + .getSyncPoller(); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource) + .block(); + } + + /** + * Create or update the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param gatewayCustomDomainResource The gateway custom domain resource for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return custom domain of the Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayCustomDomainResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, context) + .block(); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String domainName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + domainName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String domainName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (domainName == null) { + return Mono.error(new IllegalArgumentException("Parameter domainName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + domainName, + accept, + context); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String domainName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, gatewayName, domainName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String domainName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, gatewayName, domainName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String domainName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, gatewayName, domainName).getSyncPoller(); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String domainName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, gatewayName, domainName, context).getSyncPoller(); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String gatewayName, String domainName) { + return beginDeleteAsync(resourceGroupName, serviceName, gatewayName, domainName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String gatewayName, String domainName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, gatewayName, domainName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayName, String domainName) { + deleteAsync(resourceGroupName, serviceName, gatewayName, domainName).block(); + } + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayName, String domainName, Context context) { + deleteAsync(resourceGroupName, serviceName, gatewayName, domainName, context).block(); + } + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + 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())); + } + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String gatewayName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, gatewayName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, gatewayName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, gatewayName)); + } + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, gatewayName, 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 object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsImpl.java new file mode 100644 index 0000000000000..66fdd36f83c26 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsImpl.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.GatewayCustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainResource; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomains; + +public final class GatewayCustomDomainsImpl implements GatewayCustomDomains { + private static final ClientLogger LOGGER = new ClientLogger(GatewayCustomDomainsImpl.class); + + private final GatewayCustomDomainsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public GatewayCustomDomainsImpl( + GatewayCustomDomainsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String domainName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, gatewayName, domainName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayCustomDomainResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GatewayCustomDomainResource get( + String resourceGroupName, String serviceName, String gatewayName, String domainName) { + GatewayCustomDomainResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, gatewayName, domainName); + if (inner != null) { + return new GatewayCustomDomainResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String gatewayName, String domainName) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayName, domainName); + } + + public void delete( + String resourceGroupName, String serviceName, String gatewayName, String domainName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayName, domainName, context); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, gatewayName); + return Utils.mapPage(inner, inner1 -> new GatewayCustomDomainResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new GatewayCustomDomainResourceImpl(inner1, this.manager())); + } + + public GatewayCustomDomainResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayName, domainName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayName, domainName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + this.delete(resourceGroupName, serviceName, gatewayName, domainName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String domainName = Utils.getValueFromIdByName(id, "domains"); + if (domainName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'domains'.", id))); + } + this.delete(resourceGroupName, serviceName, gatewayName, domainName, context); + } + + private GatewayCustomDomainsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public GatewayCustomDomainResourceImpl define(String name) { + return new GatewayCustomDomainResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayResourceImpl.java new file mode 100644 index 0000000000000..78e1567990f59 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayResourceImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.azure.resourcemanager.appplatform.generated.models.SkuObject; +import java.util.Map; + +public final class GatewayResourceImpl implements GatewayResource, GatewayResource.Definition, GatewayResource.Update { + private GatewayResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GatewayProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public GatewayResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String gatewayName; + + private SkuObject updateGatewayCapacityResource; + + public GatewayResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public GatewayResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createOrUpdate(resourceGroupName, serviceName, gatewayName, this.innerModel(), Context.NONE); + return this; + } + + public GatewayResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createOrUpdate(resourceGroupName, serviceName, gatewayName, this.innerModel(), context); + return this; + } + + GatewayResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new GatewayResourceInner(); + this.serviceManager = serviceManager; + this.gatewayName = name; + } + + public GatewayResourceImpl update() { + this.updateGatewayCapacityResource = new SkuObject(); + return this; + } + + public GatewayResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .updateCapacity( + resourceGroupName, serviceName, gatewayName, updateGatewayCapacityResource, Context.NONE); + return this; + } + + public GatewayResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .updateCapacity(resourceGroupName, serviceName, gatewayName, updateGatewayCapacityResource, context); + return this; + } + + GatewayResourceImpl( + GatewayResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "gateways"); + } + + public GatewayResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .getWithResponse(resourceGroupName, serviceName, gatewayName, Context.NONE) + .getValue(); + return this; + } + + public GatewayResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .getWithResponse(resourceGroupName, serviceName, gatewayName, context) + .getValue(); + return this; + } + + public Response> listEnvSecretsWithResponse(Context context) { + return serviceManager + .gateways() + .listEnvSecretsWithResponse(resourceGroupName, serviceName, gatewayName, context); + } + + public Map listEnvSecrets() { + return serviceManager.gateways().listEnvSecrets(resourceGroupName, serviceName, gatewayName); + } + + public void restart() { + serviceManager.gateways().restart(resourceGroupName, serviceName, gatewayName); + } + + public void restart(Context context) { + serviceManager.gateways().restart(resourceGroupName, serviceName, gatewayName, context); + } + + public Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context) { + return serviceManager + .gateways() + .validateDomainWithResponse(resourceGroupName, serviceName, gatewayName, validatePayload, context); + } + + public CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload) { + return serviceManager.gateways().validateDomain(resourceGroupName, serviceName, gatewayName, validatePayload); + } + + public GatewayResourceImpl withProperties(GatewayProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public GatewayResourceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateGatewayCapacityResource.withSku(sku); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigResourceImpl.java new file mode 100644 index 0000000000000..00bc35b075df2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigResourceImpl.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigResource; + +public final class GatewayRouteConfigResourceImpl + implements GatewayRouteConfigResource, GatewayRouteConfigResource.Definition, GatewayRouteConfigResource.Update { + private GatewayRouteConfigResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GatewayRouteConfigProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public GatewayRouteConfigResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String gatewayName; + + private String routeConfigName; + + public GatewayRouteConfigResourceImpl withExistingGateway( + String resourceGroupName, String serviceName, String gatewayName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + this.gatewayName = gatewayName; + return this; + } + + public GatewayRouteConfigResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayRouteConfigs() + .createOrUpdate( + resourceGroupName, serviceName, gatewayName, routeConfigName, this.innerModel(), Context.NONE); + return this; + } + + public GatewayRouteConfigResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayRouteConfigs() + .createOrUpdate( + resourceGroupName, serviceName, gatewayName, routeConfigName, this.innerModel(), context); + return this; + } + + GatewayRouteConfigResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new GatewayRouteConfigResourceInner(); + this.serviceManager = serviceManager; + this.routeConfigName = name; + } + + public GatewayRouteConfigResourceImpl update() { + return this; + } + + public GatewayRouteConfigResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayRouteConfigs() + .createOrUpdate( + resourceGroupName, serviceName, gatewayName, routeConfigName, this.innerModel(), Context.NONE); + return this; + } + + public GatewayRouteConfigResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayRouteConfigs() + .createOrUpdate( + resourceGroupName, serviceName, gatewayName, routeConfigName, this.innerModel(), context); + return this; + } + + GatewayRouteConfigResourceImpl( + GatewayRouteConfigResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.gatewayName = Utils.getValueFromIdByName(innerObject.id(), "gateways"); + this.routeConfigName = Utils.getValueFromIdByName(innerObject.id(), "routeConfigs"); + } + + public GatewayRouteConfigResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayRouteConfigs() + .getWithResponse(resourceGroupName, serviceName, gatewayName, routeConfigName, Context.NONE) + .getValue(); + return this; + } + + public GatewayRouteConfigResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGatewayRouteConfigs() + .getWithResponse(resourceGroupName, serviceName, gatewayName, routeConfigName, context) + .getValue(); + return this; + } + + public GatewayRouteConfigResourceImpl withProperties(GatewayRouteConfigProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsClientImpl.java new file mode 100644 index 0000000000000..011cfdb5d8066 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsClientImpl.java @@ -0,0 +1,1279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.GatewayRouteConfigsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigResourceCollection; +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 GatewayRouteConfigsClient. */ +public final class GatewayRouteConfigsClientImpl implements GatewayRouteConfigsClient { + /** The proxy service used to perform REST calls. */ + private final GatewayRouteConfigsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of GatewayRouteConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewayRouteConfigsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(GatewayRouteConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientGatewayRouteConfigs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface GatewayRouteConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @PathParam("routeConfigName") String routeConfigName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @PathParam("routeConfigName") String routeConfigName, + @BodyParam("application/json") GatewayRouteConfigResourceInner gatewayRouteConfigResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @PathParam("routeConfigName") String routeConfigName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (routeConfigName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeConfigName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (routeConfigName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeConfigName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + accept, + context); + } + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayName, routeConfigName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayName, routeConfigName, context).block(); + } + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteConfigResourceInner get( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName) { + return getWithResponse(resourceGroupName, serviceName, gatewayName, routeConfigName, Context.NONE).getValue(); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (routeConfigName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeConfigName is required and cannot be null.")); + } + if (gatewayRouteConfigResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter gatewayRouteConfigResource is required and cannot be null.")); + } else { + gatewayRouteConfigResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (routeConfigName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeConfigName is required and cannot be null.")); + } + if (gatewayRouteConfigResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter gatewayRouteConfigResource is required and cannot be null.")); + } else { + gatewayRouteConfigResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + gatewayRouteConfigResource, + accept, + context); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayRouteConfigResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayRouteConfigResourceInner.class, + GatewayRouteConfigResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayRouteConfigResourceInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayRouteConfigResourceInner.class, + GatewayRouteConfigResourceInner.class, + context); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteConfigResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource) + .getSyncPoller(); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteConfigResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, context) + .getSyncPoller(); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteConfigResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource) { + return createOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource) + .block(); + } + + /** + * Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param gatewayRouteConfigResource The Spring Cloud Gateway route config for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway route config resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayRouteConfigResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context) { + return createOrUpdateAsync( + resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, context) + .block(); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String routeConfigName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (routeConfigName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeConfigName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String routeConfigName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (routeConfigName == null) { + return Mono + .error(new IllegalArgumentException("Parameter routeConfigName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + routeConfigName, + accept, + context); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String routeConfigName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, gatewayName, routeConfigName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String routeConfigName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, gatewayName, routeConfigName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String routeConfigName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, gatewayName, routeConfigName).getSyncPoller(); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, String routeConfigName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, serviceName, gatewayName, routeConfigName, context) + .getSyncPoller(); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String gatewayName, String routeConfigName) { + return beginDeleteAsync(resourceGroupName, serviceName, gatewayName, routeConfigName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String gatewayName, String routeConfigName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, gatewayName, routeConfigName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayName, String routeConfigName) { + deleteAsync(resourceGroupName, serviceName, gatewayName, routeConfigName).block(); + } + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayName, String routeConfigName, Context context) { + deleteAsync(resourceGroupName, serviceName, gatewayName, routeConfigName, context).block(); + } + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + 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())); + } + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String gatewayName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String gatewayName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, gatewayName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, gatewayName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, gatewayName)); + } + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, gatewayName, 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 object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsImpl.java new file mode 100644 index 0000000000000..e24fc6954e3c8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.GatewayRouteConfigsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigResource; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigs; + +public final class GatewayRouteConfigsImpl implements GatewayRouteConfigs { + private static final ClientLogger LOGGER = new ClientLogger(GatewayRouteConfigsImpl.class); + + private final GatewayRouteConfigsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public GatewayRouteConfigsImpl( + GatewayRouteConfigsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, gatewayName, routeConfigName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayRouteConfigResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GatewayRouteConfigResource get( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName) { + GatewayRouteConfigResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, gatewayName, routeConfigName); + if (inner != null) { + return new GatewayRouteConfigResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String gatewayName, String routeConfigName) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayName, routeConfigName); + } + + public void delete( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayName, routeConfigName, context); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, gatewayName); + return Utils.mapPage(inner, inner1 -> new GatewayRouteConfigResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, gatewayName, context); + return Utils.mapPage(inner, inner1 -> new GatewayRouteConfigResourceImpl(inner1, this.manager())); + } + + public GatewayRouteConfigResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String routeConfigName = Utils.getValueFromIdByName(id, "routeConfigs"); + if (routeConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeConfigs'.", id))); + } + return this + .getWithResponse(resourceGroupName, serviceName, gatewayName, routeConfigName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String routeConfigName = Utils.getValueFromIdByName(id, "routeConfigs"); + if (routeConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeConfigs'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayName, routeConfigName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String routeConfigName = Utils.getValueFromIdByName(id, "routeConfigs"); + if (routeConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeConfigs'.", id))); + } + this.delete(resourceGroupName, serviceName, gatewayName, routeConfigName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + String routeConfigName = Utils.getValueFromIdByName(id, "routeConfigs"); + if (routeConfigName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'routeConfigs'.", id))); + } + this.delete(resourceGroupName, serviceName, gatewayName, routeConfigName, context); + } + + private GatewayRouteConfigsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public GatewayRouteConfigResourceImpl define(String name) { + return new GatewayRouteConfigResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysClientImpl.java new file mode 100644 index 0000000000000..5546a5618291b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysClientImpl.java @@ -0,0 +1,2152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.GatewaysClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.SkuObject; +import java.nio.ByteBuffer; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in GatewaysClient. */ +public final class GatewaysClientImpl implements GatewaysClient { + /** The proxy service used to perform REST calls. */ + private final GatewaysService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of GatewaysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GatewaysClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(GatewaysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientGateways to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface GatewaysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @BodyParam("application/json") GatewayResourceInner gatewayResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateCapacity( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @BodyParam("application/json") SkuObject gatewayCapacityResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listEnvSecrets( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validateDomain( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("gatewayName") String gatewayName, + @BodyParam("application/json") CustomDomainValidatePayload validatePayload, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context); + } + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String gatewayName) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, gatewayName, context).block(); + } + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceInner get(String resourceGroupName, String serviceName, String gatewayName) { + return getWithResponse(resourceGroupName, serviceName, gatewayName, Context.NONE).getValue(); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (gatewayResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResource is required and cannot be null.")); + } else { + gatewayResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + gatewayResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (gatewayResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter gatewayResource is required and cannot be null.")); + } else { + gatewayResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + gatewayResource, + accept, + context); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayName, gatewayResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayResourceInner.class, + GatewayResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, gatewayName, gatewayResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GatewayResourceInner.class, GatewayResourceInner.class, context); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, gatewayName, gatewayResource) + .getSyncPoller(); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, gatewayName, gatewayResource, context) + .getSyncPoller(); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, gatewayName, gatewayResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, gatewayName, gatewayResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayName, gatewayResource).block(); + } + + /** + * Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayResource The gateway for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, gatewayName, gatewayResource, context).block(); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateCapacityWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (gatewayCapacityResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter gatewayCapacityResource is required and cannot be null.")); + } else { + gatewayCapacityResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateCapacity( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + gatewayCapacityResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateCapacityWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (gatewayCapacityResource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter gatewayCapacityResource is required and cannot be null.")); + } else { + gatewayCapacityResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateCapacity( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + gatewayCapacityResource, + accept, + context); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayResourceInner> beginUpdateCapacityAsync( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource) { + Mono>> mono = + updateCapacityWithResponseAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + GatewayResourceInner.class, + GatewayResourceInner.class, + this.client.getContext()); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GatewayResourceInner> beginUpdateCapacityAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateCapacityWithResponseAsync( + resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), GatewayResourceInner.class, GatewayResourceInner.class, context); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayResourceInner> beginUpdateCapacity( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource) { + return this + .beginUpdateCapacityAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayResourceInner> beginUpdateCapacity( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + Context context) { + return this + .beginUpdateCapacityAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, context) + .getSyncPoller(); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateCapacityAsync( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource) { + return beginUpdateCapacityAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateCapacityAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + Context context) { + return beginUpdateCapacityAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceInner updateCapacity( + String resourceGroupName, String serviceName, String gatewayName, SkuObject gatewayCapacityResource) { + return updateCapacityAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource).block(); + } + + /** + * Operation to update an exiting Spring Cloud Gateway capacity. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param gatewayCapacityResource The gateway capacity for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return spring Cloud Gateway resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GatewayResourceInner updateCapacity( + String resourceGroupName, + String serviceName, + String gatewayName, + SkuObject gatewayCapacityResource, + Context context) { + return updateCapacityAsync(resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, context) + .block(); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, gatewayName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, gatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, gatewayName).getSyncPoller(); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String gatewayName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, gatewayName, context).getSyncPoller(); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String gatewayName) { + return beginDeleteAsync(resourceGroupName, serviceName, gatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String gatewayName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayName) { + deleteAsync(resourceGroupName, serviceName, gatewayName).block(); + } + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String gatewayName, Context context) { + deleteAsync(resourceGroupName, serviceName, gatewayName, context).block(); + } + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listEnvSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listEnvSecrets( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listEnvSecretsWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listEnvSecrets( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context); + } + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEnvSecretsAsync( + String resourceGroupName, String serviceName, String gatewayName) { + return listEnvSecretsWithResponseAsync(resourceGroupName, serviceName, gatewayName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listEnvSecretsWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return listEnvSecretsWithResponseAsync(resourceGroupName, serviceName, gatewayName, context).block(); + } + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Map listEnvSecrets(String resourceGroupName, String serviceName, String gatewayName) { + return listEnvSecretsWithResponse(resourceGroupName, serviceName, gatewayName, Context.NONE).getValue(); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> restartWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + accept, + context); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestartAsync( + String resourceGroupName, String serviceName, String gatewayName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, serviceName, gatewayName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestartAsync( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, serviceName, gatewayName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestart( + String resourceGroupName, String serviceName, String gatewayName) { + return this.beginRestartAsync(resourceGroupName, serviceName, gatewayName).getSyncPoller(); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginRestart( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return this.beginRestartAsync(resourceGroupName, serviceName, gatewayName, context).getSyncPoller(); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restartAsync(String resourceGroupName, String serviceName, String gatewayName) { + return beginRestartAsync(resourceGroupName, serviceName, gatewayName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 restartAsync(String resourceGroupName, String serviceName, String gatewayName, Context context) { + return beginRestartAsync(resourceGroupName, serviceName, gatewayName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restart(String resourceGroupName, String serviceName, String gatewayName) { + restartAsync(resourceGroupName, serviceName, gatewayName).block(); + } + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 restart(String resourceGroupName, String serviceName, String gatewayName, Context context) { + restartAsync(resourceGroupName, serviceName, gatewayName, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateDomainWithResponseAsync( + String resourceGroupName, String serviceName, String gatewayName, CustomDomainValidatePayload validatePayload) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (validatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter validatePayload is required and cannot be null.")); + } else { + validatePayload.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .validateDomain( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + validatePayload, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateDomainWithResponseAsync( + String resourceGroupName, + String serviceName, + String gatewayName, + CustomDomainValidatePayload validatePayload, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (gatewayName == null) { + return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null.")); + } + if (validatePayload == null) { + return Mono + .error(new IllegalArgumentException("Parameter validatePayload is required and cannot be null.")); + } else { + validatePayload.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .validateDomain( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + gatewayName, + validatePayload, + accept, + context); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateDomainAsync( + String resourceGroupName, String serviceName, String gatewayName, CustomDomainValidatePayload validatePayload) { + return validateDomainWithResponseAsync(resourceGroupName, serviceName, gatewayName, validatePayload) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String gatewayName, + CustomDomainValidatePayload validatePayload, + Context context) { + return validateDomainWithResponseAsync(resourceGroupName, serviceName, gatewayName, validatePayload, context) + .block(); + } + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CustomDomainValidateResultInner validateDomain( + String resourceGroupName, String serviceName, String gatewayName, CustomDomainValidatePayload validatePayload) { + return validateDomainWithResponse(resourceGroupName, serviceName, gatewayName, validatePayload, 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 object that includes an array of gateway resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of gateway resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysImpl.java new file mode 100644 index 0000000000000..cae2d37f76e3e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.GatewaysClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidateResult; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResource; +import com.azure.resourcemanager.appplatform.generated.models.Gateways; +import java.util.Collections; +import java.util.Map; + +public final class GatewaysImpl implements Gateways { + private static final ClientLogger LOGGER = new ClientLogger(GatewaysImpl.class); + + private final GatewaysClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public GatewaysImpl( + GatewaysClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, gatewayName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GatewayResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GatewayResource get(String resourceGroupName, String serviceName, String gatewayName) { + GatewayResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, gatewayName); + if (inner != null) { + return new GatewayResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String gatewayName) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayName); + } + + public void delete(String resourceGroupName, String serviceName, String gatewayName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, gatewayName, context); + } + + public Response> listEnvSecretsWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return this.serviceClient().listEnvSecretsWithResponse(resourceGroupName, serviceName, gatewayName, context); + } + + public Map listEnvSecrets(String resourceGroupName, String serviceName, String gatewayName) { + Map inner = this.serviceClient().listEnvSecrets(resourceGroupName, serviceName, gatewayName); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public void restart(String resourceGroupName, String serviceName, String gatewayName) { + this.serviceClient().restart(resourceGroupName, serviceName, gatewayName); + } + + public void restart(String resourceGroupName, String serviceName, String gatewayName, Context context) { + this.serviceClient().restart(resourceGroupName, serviceName, gatewayName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new GatewayResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new GatewayResourceImpl(inner1, this.manager())); + } + + public Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String gatewayName, + CustomDomainValidatePayload validatePayload, + Context context) { + Response inner = + this + .serviceClient() + .validateDomainWithResponse(resourceGroupName, serviceName, gatewayName, validatePayload, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CustomDomainValidateResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CustomDomainValidateResult validateDomain( + String resourceGroupName, String serviceName, String gatewayName, CustomDomainValidatePayload validatePayload) { + CustomDomainValidateResultInner inner = + this.serviceClient().validateDomain(resourceGroupName, serviceName, gatewayName, validatePayload); + if (inner != null) { + return new CustomDomainValidateResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public GatewayResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, gatewayName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + this.delete(resourceGroupName, serviceName, gatewayName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String gatewayName = Utils.getValueFromIdByName(id, "gateways"); + if (gatewayName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'gateways'.", id))); + } + this.delete(resourceGroupName, serviceName, gatewayName, context); + } + + private GatewaysClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public GatewayResourceImpl define(String name) { + return new GatewayResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GloballyEnabledApmsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GloballyEnabledApmsImpl.java new file mode 100644 index 0000000000000..de47516f2993a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GloballyEnabledApmsImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.GloballyEnabledApmsInner; +import com.azure.resourcemanager.appplatform.generated.models.GloballyEnabledApms; +import java.util.Collections; +import java.util.List; + +public final class GloballyEnabledApmsImpl implements GloballyEnabledApms { + private GloballyEnabledApmsInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + GloballyEnabledApmsImpl( + GloballyEnabledApmsInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 GloballyEnabledApmsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/LogFileUrlResponseImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/LogFileUrlResponseImpl.java new file mode 100644 index 0000000000000..cc0332b457016 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/LogFileUrlResponseImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.LogFileUrlResponseInner; +import com.azure.resourcemanager.appplatform.generated.models.LogFileUrlResponse; + +public final class LogFileUrlResponseImpl implements LogFileUrlResponse { + private LogFileUrlResponseInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + LogFileUrlResponseImpl( + LogFileUrlResponseInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String url() { + return this.innerModel().url(); + } + + public LogFileUrlResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingResourceImpl.java new file mode 100644 index 0000000000000..a4d35fc315a16 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingResource; + +public final class MonitoringSettingResourceImpl implements MonitoringSettingResource { + private MonitoringSettingResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + MonitoringSettingResourceImpl( + MonitoringSettingResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 MonitoringSettingProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public MonitoringSettingResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsClientImpl.java new file mode 100644 index 0000000000000..bb54303c54cef --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsClientImpl.java @@ -0,0 +1,864 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +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.appplatform.generated.fluent.MonitoringSettingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +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 MonitoringSettingsClient. */ +public final class MonitoringSettingsClientImpl implements MonitoringSettingsClient { + /** The proxy service used to perform REST calls. */ + private final MonitoringSettingsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of MonitoringSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MonitoringSettingsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(MonitoringSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientMonitoringSettings to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface MonitoringSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePut( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") MonitoringSettingResourceInner monitoringSettingResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updatePatch( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") MonitoringSettingResourceInner monitoringSettingResource, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName) { + return getWithResponseAsync(resourceGroupName, serviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringSettingResourceInner get(String resourceGroupName, String serviceName) { + return getWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (monitoringSettingResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter monitoringSettingResource is required and cannot be null.")); + } else { + monitoringSettingResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + monitoringSettingResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePutWithResponseAsync( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (monitoringSettingResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter monitoringSettingResource is required and cannot be null.")); + } else { + monitoringSettingResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePut( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + monitoringSettingResource, + accept, + context); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoringSettingResourceInner> beginUpdatePutAsync( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + Mono>> mono = + updatePutWithResponseAsync(resourceGroupName, serviceName, monitoringSettingResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoringSettingResourceInner.class, + MonitoringSettingResourceInner.class, + this.client.getContext()); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoringSettingResourceInner> beginUpdatePutAsync( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePutWithResponseAsync(resourceGroupName, serviceName, monitoringSettingResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoringSettingResourceInner.class, + MonitoringSettingResourceInner.class, + context); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return this.beginUpdatePutAsync(resourceGroupName, serviceName, monitoringSettingResource).getSyncPoller(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return this + .beginUpdatePutAsync(resourceGroupName, serviceName, monitoringSettingResource, context) + .getSyncPoller(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return beginUpdatePutAsync(resourceGroupName, serviceName, monitoringSettingResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePutAsync( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return beginUpdatePutAsync(resourceGroupName, serviceName, monitoringSettingResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringSettingResourceInner updatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return updatePutAsync(resourceGroupName, serviceName, monitoringSettingResource).block(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringSettingResourceInner updatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return updatePutAsync(resourceGroupName, serviceName, monitoringSettingResource, context).block(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePatchWithResponseAsync( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (monitoringSettingResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter monitoringSettingResource is required and cannot be null.")); + } else { + monitoringSettingResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updatePatch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + monitoringSettingResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updatePatchWithResponseAsync( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (monitoringSettingResource == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter monitoringSettingResource is required and cannot be null.")); + } else { + monitoringSettingResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updatePatch( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + monitoringSettingResource, + accept, + context); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoringSettingResourceInner> + beginUpdatePatchAsync( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + Mono>> mono = + updatePatchWithResponseAsync(resourceGroupName, serviceName, monitoringSettingResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoringSettingResourceInner.class, + MonitoringSettingResourceInner.class, + this.client.getContext()); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MonitoringSettingResourceInner> + beginUpdatePatchAsync( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updatePatchWithResponseAsync(resourceGroupName, serviceName, monitoringSettingResource, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + MonitoringSettingResourceInner.class, + MonitoringSettingResourceInner.class, + context); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return this.beginUpdatePatchAsync(resourceGroupName, serviceName, monitoringSettingResource).getSyncPoller(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return this + .beginUpdatePatchAsync(resourceGroupName, serviceName, monitoringSettingResource, context) + .getSyncPoller(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePatchAsync( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return beginUpdatePatchAsync(resourceGroupName, serviceName, monitoringSettingResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updatePatchAsync( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return beginUpdatePatchAsync(resourceGroupName, serviceName, monitoringSettingResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringSettingResourceInner updatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return updatePatchAsync(resourceGroupName, serviceName, monitoringSettingResource).block(); + } + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MonitoringSettingResourceInner updatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return updatePatchAsync(resourceGroupName, serviceName, monitoringSettingResource, context).block(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsImpl.java new file mode 100644 index 0000000000000..53143eb19a302 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsImpl.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.appplatform.generated.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.appplatform.generated.fluent.MonitoringSettingsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingResource; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettings; + +public final class MonitoringSettingsImpl implements MonitoringSettings { + private static final ClientLogger LOGGER = new ClientLogger(MonitoringSettingsImpl.class); + + private final MonitoringSettingsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public MonitoringSettingsImpl( + MonitoringSettingsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MonitoringSettingResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MonitoringSettingResource get(String resourceGroupName, String serviceName) { + MonitoringSettingResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName); + if (inner != null) { + return new MonitoringSettingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoringSettingResource updatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + MonitoringSettingResourceInner inner = + this.serviceClient().updatePut(resourceGroupName, serviceName, monitoringSettingResource); + if (inner != null) { + return new MonitoringSettingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoringSettingResource updatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + MonitoringSettingResourceInner inner = + this.serviceClient().updatePut(resourceGroupName, serviceName, monitoringSettingResource, context); + if (inner != null) { + return new MonitoringSettingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoringSettingResource updatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + MonitoringSettingResourceInner inner = + this.serviceClient().updatePatch(resourceGroupName, serviceName, monitoringSettingResource); + if (inner != null) { + return new MonitoringSettingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public MonitoringSettingResource updatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + MonitoringSettingResourceInner inner = + this.serviceClient().updatePatch(resourceGroupName, serviceName, monitoringSettingResource, context); + if (inner != null) { + return new MonitoringSettingResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private MonitoringSettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/NameAvailabilityImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/NameAvailabilityImpl.java new file mode 100644 index 0000000000000..ef238c7354099 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/NameAvailabilityImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.models.NameAvailability; + +public final class NameAvailabilityImpl implements NameAvailability { + private NameAvailabilityInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + NameAvailabilityImpl( + NameAvailabilityInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationDetailImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationDetailImpl.java new file mode 100644 index 0000000000000..1b3b88d9686da --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationDetailImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.appplatform.generated.models.ActionType; +import com.azure.resourcemanager.appplatform.generated.models.OperationDetail; +import com.azure.resourcemanager.appplatform.generated.models.OperationDisplay; +import com.azure.resourcemanager.appplatform.generated.models.OperationProperties; + +public final class OperationDetailImpl implements OperationDetail { + private OperationDetailInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + OperationDetailImpl( + OperationDetailInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 ActionType actionType() { + return this.innerModel().actionType(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + + public OperationDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..629c4d3394a24 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.OperationsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.appplatform.generated.models.AvailableOperations; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientOperations to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.AppPlatform/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..05fcb28aa8501 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsImpl.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.appplatform.generated.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.appplatform.generated.fluent.OperationsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.appplatform.generated.models.OperationDetail; +import com.azure.resourcemanager.appplatform.generated.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorResourceImpl.java new file mode 100644 index 0000000000000..781efc268c6f6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAcceleratorResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +public final class PredefinedAcceleratorResourceImpl implements PredefinedAcceleratorResource { + private PredefinedAcceleratorResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + PredefinedAcceleratorResourceImpl( + PredefinedAcceleratorResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 PredefinedAcceleratorProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public PredefinedAcceleratorResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorsClientImpl.java new file mode 100644 index 0000000000000..5737a746fce4b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorsClientImpl.java @@ -0,0 +1,1310 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.Post; +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.appplatform.generated.fluent.PredefinedAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAcceleratorResourceCollection; +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 PredefinedAcceleratorsClient. */ +public final class PredefinedAcceleratorsClientImpl implements PredefinedAcceleratorsClient { + /** The proxy service used to perform REST calls. */ + private final PredefinedAcceleratorsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of PredefinedAcceleratorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PredefinedAcceleratorsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy + .create(PredefinedAcceleratorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientPredefinedAccelerators to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface PredefinedAcceleratorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("predefinedAcceleratorName") String predefinedAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disable( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("predefinedAcceleratorName") String predefinedAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enable( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("applicationAcceleratorName") String applicationAcceleratorName, + @PathParam("predefinedAcceleratorName") String predefinedAcceleratorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + 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())); + } + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, applicationAcceleratorName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, applicationAcceleratorName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, applicationAcceleratorName)); + } + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, applicationAcceleratorName, context)); + } + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (predefinedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter predefinedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + predefinedAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (predefinedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter predefinedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + predefinedAcceleratorName, + accept, + context); + } + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + return getWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + return getWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .block(); + } + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PredefinedAcceleratorResourceInner get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + return getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, Context.NONE) + .getValue(); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disableWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (predefinedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter predefinedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disable( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + predefinedAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disableWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (predefinedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter predefinedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disable( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + predefinedAcceleratorName, + accept, + context); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + Mono>> mono = + disableWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + return this + .beginDisableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName) + .getSyncPoller(); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + return this + .beginDisableAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .getSyncPoller(); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + return beginDisableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + return beginDisableAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + disableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName).block(); + } + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + disableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .block(); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> enableWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (predefinedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter predefinedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enable( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + predefinedAcceleratorName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> enableWithResponseAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (applicationAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter applicationAcceleratorName is required and cannot be null.")); + } + if (predefinedAcceleratorName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter predefinedAcceleratorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enable( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + applicationAcceleratorName, + predefinedAcceleratorName, + accept, + context); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + Mono>> mono = + enableWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableWithResponseAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + return this + .beginEnableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName) + .getSyncPoller(); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + return this + .beginEnableAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .getSyncPoller(); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 enableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + return beginEnableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 enableAsync( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + return beginEnableAsync( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + enableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName).block(); + } + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + enableAsync(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorsImpl.java new file mode 100644 index 0000000000000..1fd350dd8ef45 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/PredefinedAcceleratorsImpl.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.PredefinedAcceleratorsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAcceleratorResource; +import com.azure.resourcemanager.appplatform.generated.models.PredefinedAccelerators; + +public final class PredefinedAcceleratorsImpl implements PredefinedAccelerators { + private static final ClientLogger LOGGER = new ClientLogger(PredefinedAcceleratorsImpl.class); + + private final PredefinedAcceleratorsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public PredefinedAcceleratorsImpl( + PredefinedAcceleratorsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, applicationAcceleratorName); + return Utils.mapPage(inner, inner1 -> new PredefinedAcceleratorResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, applicationAcceleratorName, context); + return Utils.mapPage(inner, inner1 -> new PredefinedAcceleratorResourceImpl(inner1, this.manager())); + } + + public Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PredefinedAcceleratorResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PredefinedAcceleratorResource get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + PredefinedAcceleratorResourceInner inner = + this + .serviceClient() + .get(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName); + if (inner != null) { + return new PredefinedAcceleratorResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + this + .serviceClient() + .disable(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName); + } + + public void disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + this + .serviceClient() + .disable(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context); + } + + public void enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName) { + this + .serviceClient() + .enable(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName); + } + + public void enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context) { + this + .serviceClient() + .enable(resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, context); + } + + private PredefinedAcceleratorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RemoteDebuggingImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RemoteDebuggingImpl.java new file mode 100644 index 0000000000000..fe05038479929 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RemoteDebuggingImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.RemoteDebuggingInner; +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebugging; + +public final class RemoteDebuggingImpl implements RemoteDebugging { + private RemoteDebuggingInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + RemoteDebuggingImpl( + RemoteDebuggingInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Integer port() { + return this.innerModel().port(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public RemoteDebuggingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ResourceSkuImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ResourceSkuImpl.java new file mode 100644 index 0000000000000..e1313a7032ef7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ResourceSkuImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSku; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSkuLocationInfo; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSkuRestrictions; +import com.azure.resourcemanager.appplatform.generated.models.SkuCapacity; +import java.util.Collections; +import java.util.List; + +public final class ResourceSkuImpl implements ResourceSku { + private ResourceSkuInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ResourceSkuImpl( + ResourceSkuInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceType() { + return this.innerModel().resourceType(); + } + + public String name() { + return this.innerModel().name(); + } + + public String tier() { + return this.innerModel().tier(); + } + + public SkuCapacity capacity() { + return this.innerModel().capacity(); + } + + public List locations() { + List inner = this.innerModel().locations(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List locationInfo() { + List inner = this.innerModel().locationInfo(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List restrictions() { + List inner = this.innerModel().restrictions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ResourceSkuInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ResourceUploadDefinitionImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ResourceUploadDefinitionImpl.java new file mode 100644 index 0000000000000..57cc8a7ab795a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ResourceUploadDefinitionImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; +import com.azure.resourcemanager.appplatform.generated.models.ResourceUploadDefinition; + +public final class ResourceUploadDefinitionImpl implements ResourceUploadDefinition { + private ResourceUploadDefinitionInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ResourceUploadDefinitionImpl( + ResourceUploadDefinitionInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String relativePath() { + return this.innerModel().relativePath(); + } + + public String uploadUrl() { + return this.innerModel().uploadUrl(); + } + + public ResourceUploadDefinitionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsClientImpl.java new file mode 100644 index 0000000000000..ee0a45d28469e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsClientImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appplatform.generated.fluent.RuntimeVersionsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AvailableRuntimeVersionsInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RuntimeVersionsClient. */ +public final class RuntimeVersionsClientImpl implements RuntimeVersionsClient { + /** The proxy service used to perform REST calls. */ + private final RuntimeVersionsService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of RuntimeVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RuntimeVersionsClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(RuntimeVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientRuntimeVersions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface RuntimeVersionsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.AppPlatform/runtimeVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRuntimeVersions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws ManagementException 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> listRuntimeVersionsWithResponseAsync() { + 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 + .listRuntimeVersions(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> listRuntimeVersionsWithResponseAsync(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.listRuntimeVersions(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws ManagementException 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 listRuntimeVersionsAsync() { + return listRuntimeVersionsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listRuntimeVersionsWithResponse(Context context) { + return listRuntimeVersionsWithResponseAsync(context).block(); + } + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws ManagementException 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 AvailableRuntimeVersionsInner listRuntimeVersions() { + return listRuntimeVersionsWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsImpl.java new file mode 100644 index 0000000000000..9a33513d59ce2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsImpl.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.appplatform.generated.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.appplatform.generated.fluent.RuntimeVersionsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AvailableRuntimeVersionsInner; +import com.azure.resourcemanager.appplatform.generated.models.AvailableRuntimeVersions; +import com.azure.resourcemanager.appplatform.generated.models.RuntimeVersions; + +public final class RuntimeVersionsImpl implements RuntimeVersions { + private static final ClientLogger LOGGER = new ClientLogger(RuntimeVersionsImpl.class); + + private final RuntimeVersionsClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public RuntimeVersionsImpl( + RuntimeVersionsClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listRuntimeVersionsWithResponse(Context context) { + Response inner = this.serviceClient().listRuntimeVersionsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AvailableRuntimeVersionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AvailableRuntimeVersions listRuntimeVersions() { + AvailableRuntimeVersionsInner inner = this.serviceClient().listRuntimeVersions(); + if (inner != null) { + return new AvailableRuntimeVersionsImpl(inner, this.manager()); + } else { + return null; + } + } + + private RuntimeVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesClientImpl.java new file mode 100644 index 0000000000000..933c7544e30cc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesClientImpl.java @@ -0,0 +1,1113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.ServiceRegistriesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistryResourceCollection; +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 ServiceRegistriesClient. */ +public final class ServiceRegistriesClientImpl implements ServiceRegistriesClient { + /** The proxy service used to perform REST calls. */ + private final ServiceRegistriesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ServiceRegistriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServiceRegistriesClientImpl(AppPlatformManagementClientImpl client) { + this.service = + RestProxy.create(ServiceRegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientServiceRegistries to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ServiceRegistriesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("serviceRegistryName") String serviceRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("serviceRegistryName") String serviceRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/{serviceRegistryName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("serviceRegistryName") String serviceRegistryName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String serviceRegistryName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (serviceRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + serviceRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String serviceRegistryName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (serviceRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + serviceRegistryName, + accept, + context); + } + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String serviceRegistryName) { + return getWithResponseAsync(resourceGroupName, serviceName, serviceRegistryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, serviceRegistryName, context).block(); + } + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceRegistryResourceInner get(String resourceGroupName, String serviceName, String serviceRegistryName) { + return getWithResponse(resourceGroupName, serviceName, serviceRegistryName, Context.NONE).getValue(); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String serviceRegistryName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (serviceRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + serviceRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String serviceRegistryName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (serviceRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + serviceRegistryName, + accept, + context); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceRegistryResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String serviceRegistryName) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, serviceRegistryName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceRegistryResourceInner.class, + ServiceRegistryResourceInner.class, + this.client.getContext()); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceRegistryResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, serviceRegistryName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceRegistryResourceInner.class, + ServiceRegistryResourceInner.class, + context); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName) { + return this.beginCreateOrUpdateAsync(resourceGroupName, serviceName, serviceRegistryName).getSyncPoller(); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service Registry resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, serviceRegistryName, context) + .getSyncPoller(); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String serviceRegistryName) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, serviceRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, serviceRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceRegistryResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName) { + return createOrUpdateAsync(resourceGroupName, serviceName, serviceRegistryName).block(); + } + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceRegistryResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, serviceRegistryName, context).block(); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String serviceRegistryName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (serviceRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + serviceRegistryName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String serviceRegistryName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (serviceRegistryName == null) { + return Mono + .error(new IllegalArgumentException("Parameter serviceRegistryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + serviceRegistryName, + accept, + context); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String serviceRegistryName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, serviceRegistryName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String serviceRegistryName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, serviceRegistryName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String serviceRegistryName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, serviceRegistryName).getSyncPoller(); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 serviceName, String serviceRegistryName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, serviceRegistryName, context).getSyncPoller(); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String serviceRegistryName) { + return beginDeleteAsync(resourceGroupName, serviceName, serviceRegistryName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 serviceName, String serviceRegistryName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, serviceRegistryName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String serviceRegistryName) { + deleteAsync(resourceGroupName, serviceName, serviceRegistryName).block(); + } + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 serviceName, String serviceRegistryName, Context context) { + deleteAsync(resourceGroupName, serviceName, serviceRegistryName, context).block(); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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())); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, 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 object that includes an array of Service Registry resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Service Registry resources and a possible link for next set along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesImpl.java new file mode 100644 index 0000000000000..8ba1e7cb80e2e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesImpl.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ServiceRegistriesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistries; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistryResource; + +public final class ServiceRegistriesImpl implements ServiceRegistries { + private static final ClientLogger LOGGER = new ClientLogger(ServiceRegistriesImpl.class); + + private final ServiceRegistriesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ServiceRegistriesImpl( + ServiceRegistriesClient innerClient, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, serviceRegistryName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceRegistryResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServiceRegistryResource get(String resourceGroupName, String serviceName, String serviceRegistryName) { + ServiceRegistryResourceInner inner = + this.serviceClient().get(resourceGroupName, serviceName, serviceRegistryName); + if (inner != null) { + return new ServiceRegistryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ServiceRegistryResource createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName) { + ServiceRegistryResourceInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, serviceRegistryName); + if (inner != null) { + return new ServiceRegistryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public ServiceRegistryResource createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + ServiceRegistryResourceInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, serviceName, serviceRegistryName, context); + if (inner != null) { + return new ServiceRegistryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String serviceRegistryName) { + this.serviceClient().delete(resourceGroupName, serviceName, serviceRegistryName); + } + + public void delete(String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, serviceRegistryName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new ServiceRegistryResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new ServiceRegistryResourceImpl(inner1, this.manager())); + } + + private ServiceRegistriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistryResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistryResourceImpl.java new file mode 100644 index 0000000000000..4388e23e5d456 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistryResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistryProperties; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistryResource; + +public final class ServiceRegistryResourceImpl implements ServiceRegistryResource { + private ServiceRegistryResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + ServiceRegistryResourceImpl( + ServiceRegistryResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 ServiceRegistryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ServiceRegistryResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceResourceImpl.java new file mode 100644 index 0000000000000..c697475afeec8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceResourceImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.GloballyEnabledApms; +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.generated.models.ServiceResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.azure.resourcemanager.appplatform.generated.models.TestKeys; +import java.util.Collections; +import java.util.Map; + +public final class ServiceResourceImpl implements ServiceResource, ServiceResource.Definition, ServiceResource.Update { + private ServiceResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 ClusterResourceProperties properties() { + return this.innerModel().properties(); + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ServiceResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + public ServiceResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ServiceResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public ServiceResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .createOrUpdate(resourceGroupName, serviceName, this.innerModel(), context); + return this; + } + + ServiceResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new ServiceResourceInner(); + this.serviceManager = serviceManager; + this.serviceName = name; + } + + public ServiceResourceImpl update() { + return this; + } + + public ServiceResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .update(resourceGroupName, serviceName, this.innerModel(), Context.NONE); + return this; + } + + public ServiceResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .update(resourceGroupName, serviceName, this.innerModel(), context); + return this; + } + + ServiceResourceImpl( + ServiceResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + } + + public ServiceResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, Context.NONE) + .getValue(); + return this; + } + + public ServiceResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getServices() + .getByResourceGroupWithResponse(resourceGroupName, serviceName, context) + .getValue(); + return this; + } + + public Response listTestKeysWithResponse(Context context) { + return serviceManager.services().listTestKeysWithResponse(resourceGroupName, serviceName, context); + } + + public TestKeys listTestKeys() { + return serviceManager.services().listTestKeys(resourceGroupName, serviceName); + } + + public Response regenerateTestKeyWithResponse( + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, Context context) { + return serviceManager + .services() + .regenerateTestKeyWithResponse(resourceGroupName, serviceName, regenerateTestKeyRequest, context); + } + + public TestKeys regenerateTestKey(RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { + return serviceManager.services().regenerateTestKey(resourceGroupName, serviceName, regenerateTestKeyRequest); + } + + public Response disableTestEndpointWithResponse(Context context) { + return serviceManager.services().disableTestEndpointWithResponse(resourceGroupName, serviceName, context); + } + + public void disableTestEndpoint() { + serviceManager.services().disableTestEndpoint(resourceGroupName, serviceName); + } + + public Response enableTestEndpointWithResponse(Context context) { + return serviceManager.services().enableTestEndpointWithResponse(resourceGroupName, serviceName, context); + } + + public TestKeys enableTestEndpoint() { + return serviceManager.services().enableTestEndpoint(resourceGroupName, serviceName); + } + + public void stop() { + serviceManager.services().stop(resourceGroupName, serviceName); + } + + public void stop(Context context) { + serviceManager.services().stop(resourceGroupName, serviceName, context); + } + + public void start() { + serviceManager.services().start(resourceGroupName, serviceName); + } + + public void start(Context context) { + serviceManager.services().start(resourceGroupName, serviceName, context); + } + + public void flushVnetDnsSetting() { + serviceManager.services().flushVnetDnsSetting(resourceGroupName, serviceName); + } + + public void flushVnetDnsSetting(Context context) { + serviceManager.services().flushVnetDnsSetting(resourceGroupName, serviceName, context); + } + + public Response listGloballyEnabledApmsWithResponse(Context context) { + return serviceManager.services().listGloballyEnabledApmsWithResponse(resourceGroupName, serviceName, context); + } + + public GloballyEnabledApms listGloballyEnabledApms() { + return serviceManager.services().listGloballyEnabledApms(resourceGroupName, serviceName); + } + + public void enableApmGlobally(ApmReference apm) { + serviceManager.services().enableApmGlobally(resourceGroupName, serviceName, apm); + } + + public void enableApmGlobally(ApmReference apm, Context context) { + serviceManager.services().enableApmGlobally(resourceGroupName, serviceName, apm, context); + } + + public void disableApmGlobally(ApmReference apm) { + serviceManager.services().disableApmGlobally(resourceGroupName, serviceName, apm); + } + + public void disableApmGlobally(ApmReference apm, Context context) { + serviceManager.services().disableApmGlobally(resourceGroupName, serviceName, apm, context); + } + + public ServiceResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ServiceResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ServiceResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public ServiceResourceImpl withProperties(ClusterResourceProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ServiceResourceImpl withSku(Sku sku) { + this.innerModel().withSku(sku); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesClientImpl.java new file mode 100644 index 0000000000000..1fe1dd9a57b09 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesClientImpl.java @@ -0,0 +1,4506 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GloballyEnabledApmsInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.NameAvailabilityParameters; +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.generated.models.ServiceResourceList; +import com.azure.resourcemanager.appplatform.generated.models.SupportedApmTypes; +import com.azure.resourcemanager.appplatform.generated.models.SupportedServerVersions; +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 ServicesClient. */ +public final class ServicesClientImpl implements ServicesClient { + /** The proxy service used to perform REST calls. */ + private final ServicesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of ServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServicesClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientServices to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface ServicesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ServiceResourceInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ServiceResourceInner resource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTestKeys( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateTestKey( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disableTestEndpoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enableTestEndpoint( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType( + value = ManagementException.class, + code = {404, 409}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType( + value = ManagementException.class, + code = {404, 409}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> flushVnetDnsSetting( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedApmTypes( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGloballyEnabledApms( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableApmGlobally( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ApmReference apm, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableApmGlobally( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @BodyParam("application/json") ApmReference apm, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @BodyParam("application/json") NameAvailabilityParameters availabilityParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedServerVersions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedApmTypesNext( + @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); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSupportedServerVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String serviceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner getByResourceGroup(String resourceGroupName, String serviceName) { + return getByResourceGroupWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + accept, + context); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, resource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceResourceInner.class, + ServiceResourceInner.class, + this.client.getContext()); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, resource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class, context); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource).getSyncPoller(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource, context).getSyncPoller(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return createOrUpdateAsync(resourceGroupName, serviceName, resource).block(); + } + + /** + * Create a new Service or update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner createOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, resource, context).block(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String serviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName) { + return this.beginDeleteAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName) { + return beginDeleteAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName) { + deleteAsync(resourceGroupName, serviceName).block(); + } + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, Context context) { + deleteAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + resource, + accept, + context); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, serviceName, resource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServiceResourceInner.class, + ServiceResourceInner.class, + this.client.getContext()); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ServiceResourceInner> beginUpdateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, serviceName, resource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ServiceResourceInner.class, ServiceResourceInner.class, context); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return this.beginUpdateAsync(resourceGroupName, serviceName, resource).getSyncPoller(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of service resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return this.beginUpdateAsync(resourceGroupName, serviceName, resource, context).getSyncPoller(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return beginUpdateAsync(resourceGroupName, serviceName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return beginUpdateAsync(resourceGroupName, serviceName, resource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner update(String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return updateAsync(resourceGroupName, serviceName, resource).block(); + } + + /** + * Operation to update an exiting Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param resource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner update( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return updateAsync(resourceGroupName, serviceName, resource, context).block(); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestKeysWithResponseAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listTestKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTestKeysWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listTestKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listTestKeysAsync(String resourceGroupName, String serviceName) { + return listTestKeysWithResponseAsync(resourceGroupName, serviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listTestKeysWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listTestKeysWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeysInner listTestKeys(String resourceGroupName, String serviceName) { + return listTestKeysWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateTestKeyWithResponseAsync( + String resourceGroupName, String serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (regenerateTestKeyRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter regenerateTestKeyRequest is required and cannot be null.")); + } else { + regenerateTestKeyRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateTestKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + regenerateTestKeyRequest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateTestKeyWithResponseAsync( + String resourceGroupName, + String serviceName, + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (regenerateTestKeyRequest == null) { + return Mono + .error( + new IllegalArgumentException("Parameter regenerateTestKeyRequest is required and cannot be null.")); + } else { + regenerateTestKeyRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateTestKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + regenerateTestKeyRequest, + accept, + context); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateTestKeyAsync( + String resourceGroupName, String serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { + return regenerateTestKeyWithResponseAsync(resourceGroupName, serviceName, regenerateTestKeyRequest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateTestKeyWithResponse( + String resourceGroupName, + String serviceName, + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + Context context) { + return regenerateTestKeyWithResponseAsync(resourceGroupName, serviceName, regenerateTestKeyRequest, context) + .block(); + } + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeysInner regenerateTestKey( + String resourceGroupName, String serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { + return regenerateTestKeyWithResponse(resourceGroupName, serviceName, regenerateTestKeyRequest, Context.NONE) + .getValue(); + } + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disableTestEndpointWithResponseAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableTestEndpointAsync(String resourceGroupName, String serviceName) { + return disableTestEndpointWithResponseAsync(resourceGroupName, serviceName).flatMap(ignored -> Mono.empty()); + } + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disableTestEndpointWithResponse( + String resourceGroupName, String serviceName, Context context) { + return disableTestEndpointWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableTestEndpoint(String resourceGroupName, String serviceName) { + disableTestEndpointWithResponse(resourceGroupName, serviceName, Context.NONE); + } + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> enableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> enableTestEndpointWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableTestEndpoint( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableTestEndpointAsync(String resourceGroupName, String serviceName) { + return enableTestEndpointWithResponseAsync(resourceGroupName, serviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableTestEndpointWithResponse( + String resourceGroupName, String serviceName, Context context) { + return enableTestEndpointWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TestKeysInner enableTestEndpoint(String resourceGroupName, String serviceName) { + return enableTestEndpointWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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>> stopWithResponseAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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>> stopWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStopAsync(String resourceGroupName, String serviceName) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, serviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStopAsync( + String resourceGroupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = stopWithResponseAsync(resourceGroupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStop(String resourceGroupName, String serviceName) { + return this.beginStopAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStop(String resourceGroupName, String serviceName, Context context) { + return this.beginStopAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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 stopAsync(String resourceGroupName, String serviceName) { + return beginStopAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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 stopAsync(String resourceGroupName, String serviceName, Context context) { + return beginStopAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String serviceName) { + stopAsync(resourceGroupName, serviceName).block(); + } + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String serviceName, Context context) { + stopAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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>> startWithResponseAsync(String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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>> startWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStartAsync(String resourceGroupName, String serviceName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, serviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStartAsync( + String resourceGroupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStart(String resourceGroupName, String serviceName) { + return this.beginStartAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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> beginStart( + String resourceGroupName, String serviceName, Context context) { + return this.beginStartAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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 startAsync(String resourceGroupName, String serviceName) { + return beginStartAsync(resourceGroupName, serviceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @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 startAsync(String resourceGroupName, String serviceName, Context context) { + return beginStartAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String serviceName) { + startAsync(resourceGroupName, serviceName).block(); + } + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String serviceName, Context context) { + startAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> flushVnetDnsSettingWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .flushVnetDnsSetting( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> flushVnetDnsSettingWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .flushVnetDnsSetting( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFlushVnetDnsSettingAsync( + String resourceGroupName, String serviceName) { + Mono>> mono = flushVnetDnsSettingWithResponseAsync(resourceGroupName, serviceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFlushVnetDnsSettingAsync( + String resourceGroupName, String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + flushVnetDnsSettingWithResponseAsync(resourceGroupName, serviceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFlushVnetDnsSetting(String resourceGroupName, String serviceName) { + return this.beginFlushVnetDnsSettingAsync(resourceGroupName, serviceName).getSyncPoller(); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFlushVnetDnsSetting( + String resourceGroupName, String serviceName, Context context) { + return this.beginFlushVnetDnsSettingAsync(resourceGroupName, serviceName, context).getSyncPoller(); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono flushVnetDnsSettingAsync(String resourceGroupName, String serviceName) { + return beginFlushVnetDnsSettingAsync(resourceGroupName, serviceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono flushVnetDnsSettingAsync(String resourceGroupName, String serviceName, Context context) { + return beginFlushVnetDnsSettingAsync(resourceGroupName, serviceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void flushVnetDnsSetting(String resourceGroupName, String serviceName) { + flushVnetDnsSettingAsync(resourceGroupName, serviceName).block(); + } + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void flushVnetDnsSetting(String resourceGroupName, String serviceName, Context context) { + flushVnetDnsSettingAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedApmTypesSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSupportedApmTypes( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedApmTypesSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSupportedApmTypes( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSupportedApmTypesAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSupportedApmTypesSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listSupportedApmTypesNextSinglePageAsync(nextLink)); + } + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSupportedApmTypesAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSupportedApmTypesSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listSupportedApmTypesNextSinglePageAsync(nextLink, context)); + } + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSupportedApmTypes(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listSupportedApmTypesAsync(resourceGroupName, serviceName)); + } + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSupportedApmTypes( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listSupportedApmTypesAsync(resourceGroupName, serviceName, context)); + } + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGloballyEnabledApmsWithResponseAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listGloballyEnabledApms( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGloballyEnabledApmsWithResponseAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listGloballyEnabledApms( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context); + } + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listGloballyEnabledApmsAsync(String resourceGroupName, String serviceName) { + return listGloballyEnabledApmsWithResponseAsync(resourceGroupName, serviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listGloballyEnabledApmsWithResponse( + String resourceGroupName, String serviceName, Context context) { + return listGloballyEnabledApmsWithResponseAsync(resourceGroupName, serviceName, context).block(); + } + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GloballyEnabledApmsInner listGloballyEnabledApms(String resourceGroupName, String serviceName) { + return listGloballyEnabledApmsWithResponse(resourceGroupName, serviceName, Context.NONE).getValue(); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> enableApmGloballyWithResponseAsync( + String resourceGroupName, String serviceName, ApmReference apm) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apm == null) { + return Mono.error(new IllegalArgumentException("Parameter apm is required and cannot be null.")); + } else { + apm.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableApmGlobally( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apm, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableApmGloballyWithResponseAsync( + String resourceGroupName, String serviceName, ApmReference apm, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apm == null) { + return Mono.error(new IllegalArgumentException("Parameter apm is required and cannot be null.")); + } else { + apm.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableApmGlobally( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apm, + accept, + context); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableApmGloballyAsync( + String resourceGroupName, String serviceName, ApmReference apm) { + Mono>> mono = enableApmGloballyWithResponseAsync(resourceGroupName, serviceName, apm); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginEnableApmGloballyAsync( + String resourceGroupName, String serviceName, ApmReference apm, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableApmGloballyWithResponseAsync(resourceGroupName, serviceName, apm, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginEnableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm) { + return this.beginEnableApmGloballyAsync(resourceGroupName, serviceName, apm).getSyncPoller(); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginEnableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm, Context context) { + return this.beginEnableApmGloballyAsync(resourceGroupName, serviceName, apm, context).getSyncPoller(); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 enableApmGloballyAsync(String resourceGroupName, String serviceName, ApmReference apm) { + return beginEnableApmGloballyAsync(resourceGroupName, serviceName, apm) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableApmGloballyAsync( + String resourceGroupName, String serviceName, ApmReference apm, Context context) { + return beginEnableApmGloballyAsync(resourceGroupName, serviceName, apm, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm) { + enableApmGloballyAsync(resourceGroupName, serviceName, apm).block(); + } + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context) { + enableApmGloballyAsync(resourceGroupName, serviceName, apm, context).block(); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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>> disableApmGloballyWithResponseAsync( + String resourceGroupName, String serviceName, ApmReference apm) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apm == null) { + return Mono.error(new IllegalArgumentException("Parameter apm is required and cannot be null.")); + } else { + apm.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableApmGlobally( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apm, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableApmGloballyWithResponseAsync( + String resourceGroupName, String serviceName, ApmReference apm, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (apm == null) { + return Mono.error(new IllegalArgumentException("Parameter apm is required and cannot be null.")); + } else { + apm.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableApmGlobally( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + apm, + accept, + context); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableApmGloballyAsync( + String resourceGroupName, String serviceName, ApmReference apm) { + Mono>> mono = + disableApmGloballyWithResponseAsync(resourceGroupName, serviceName, apm); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDisableApmGloballyAsync( + String resourceGroupName, String serviceName, ApmReference apm, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableApmGloballyWithResponseAsync(resourceGroupName, serviceName, apm, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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> beginDisableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm) { + return this.beginDisableApmGloballyAsync(resourceGroupName, serviceName, apm).getSyncPoller(); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDisableApmGlobally( + String resourceGroupName, String serviceName, ApmReference apm, Context context) { + return this.beginDisableApmGloballyAsync(resourceGroupName, serviceName, apm, context).getSyncPoller(); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 disableApmGloballyAsync(String resourceGroupName, String serviceName, ApmReference apm) { + return beginDisableApmGloballyAsync(resourceGroupName, serviceName, apm) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableApmGloballyAsync( + String resourceGroupName, String serviceName, ApmReference apm, Context context) { + return beginDisableApmGloballyAsync(resourceGroupName, serviceName, apm, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm) { + disableApmGloballyAsync(resourceGroupName, serviceName, apm).block(); + } + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context) { + disableApmGloballyAsync(resourceGroupName, serviceName, apm, context).block(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters availabilityParameters) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (availabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null.")); + } else { + availabilityParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + availabilityParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters availabilityParameters, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (availabilityParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter availabilityParameters is required and cannot be null.")); + } else { + availabilityParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + location, + availabilityParameters, + accept, + context); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityWithResponseAsync(location, availabilityParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, availabilityParameters, context).block(); + } + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability( + String location, NameAvailabilityParameters availabilityParameters) { + return checkNameAvailabilityWithResponse(location, availabilityParameters, Context.NONE).getValue(); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set 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.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set 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.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + 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())); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set 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.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set 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 of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedServerVersionsSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSupportedServerVersions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + 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 server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedServerVersionsSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSupportedServerVersions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSupportedServerVersionsAsync( + String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSupportedServerVersionsSinglePageAsync(resourceGroupName, serviceName), + nextLink -> listSupportedServerVersionsNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSupportedServerVersionsAsync( + String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSupportedServerVersionsSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listSupportedServerVersionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName) { + return new PagedIterable<>(listSupportedServerVersionsAsync(resourceGroupName, serviceName)); + } + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listSupportedServerVersionsAsync(resourceGroupName, serviceName, 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 supported APM types payload along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedApmTypesNextSinglePageAsync(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.listSupportedApmTypesNext(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 supported APM types payload along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedApmTypesNextSinglePageAsync( + 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 + .listSupportedApmTypesNext(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 object that includes an array of Service resources and a possible link for next set 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 object that includes an array of Service resources and a possible link for next set 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)); + } + + /** + * 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 object that includes an array of Service resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Service resources and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 supported server versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedServerVersionsNextSinglePageAsync( + 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.listSupportedServerVersionsNext(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 supported server versions along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSupportedServerVersionsNextSinglePageAsync( + 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 + .listSupportedServerVersionsNext(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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..6ef44452a4525 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesImpl.java @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.ServicesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GloballyEnabledApmsInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.GloballyEnabledApms; +import com.azure.resourcemanager.appplatform.generated.models.NameAvailability; +import com.azure.resourcemanager.appplatform.generated.models.NameAvailabilityParameters; +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.generated.models.ServiceResource; +import com.azure.resourcemanager.appplatform.generated.models.Services; +import com.azure.resourcemanager.appplatform.generated.models.SupportedApmType; +import com.azure.resourcemanager.appplatform.generated.models.SupportedServerVersion; +import com.azure.resourcemanager.appplatform.generated.models.TestKeys; + +public final class ServicesImpl implements Services { + private static final ClientLogger LOGGER = new ClientLogger(ServicesImpl.class); + + private final ServicesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public ServicesImpl( + ServicesClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServiceResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ServiceResource getByResourceGroup(String resourceGroupName, String serviceName) { + ServiceResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, serviceName); + if (inner != null) { + return new ServiceResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String serviceName) { + this.serviceClient().delete(resourceGroupName, serviceName); + } + + public void delete(String resourceGroupName, String serviceName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, context); + } + + public Response listTestKeysWithResponse(String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().listTestKeysWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TestKeys listTestKeys(String resourceGroupName, String serviceName) { + TestKeysInner inner = this.serviceClient().listTestKeys(resourceGroupName, serviceName); + if (inner != null) { + return new TestKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateTestKeyWithResponse( + String resourceGroupName, + String serviceName, + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + Context context) { + Response inner = + this + .serviceClient() + .regenerateTestKeyWithResponse(resourceGroupName, serviceName, regenerateTestKeyRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TestKeys regenerateTestKey( + String resourceGroupName, String serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { + TestKeysInner inner = + this.serviceClient().regenerateTestKey(resourceGroupName, serviceName, regenerateTestKeyRequest); + if (inner != null) { + return new TestKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response disableTestEndpointWithResponse( + String resourceGroupName, String serviceName, Context context) { + return this.serviceClient().disableTestEndpointWithResponse(resourceGroupName, serviceName, context); + } + + public void disableTestEndpoint(String resourceGroupName, String serviceName) { + this.serviceClient().disableTestEndpoint(resourceGroupName, serviceName); + } + + public Response enableTestEndpointWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().enableTestEndpointWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TestKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TestKeys enableTestEndpoint(String resourceGroupName, String serviceName) { + TestKeysInner inner = this.serviceClient().enableTestEndpoint(resourceGroupName, serviceName); + if (inner != null) { + return new TestKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public void stop(String resourceGroupName, String serviceName) { + this.serviceClient().stop(resourceGroupName, serviceName); + } + + public void stop(String resourceGroupName, String serviceName, Context context) { + this.serviceClient().stop(resourceGroupName, serviceName, context); + } + + public void start(String resourceGroupName, String serviceName) { + this.serviceClient().start(resourceGroupName, serviceName); + } + + public void start(String resourceGroupName, String serviceName, Context context) { + this.serviceClient().start(resourceGroupName, serviceName, context); + } + + public void flushVnetDnsSetting(String resourceGroupName, String serviceName) { + this.serviceClient().flushVnetDnsSetting(resourceGroupName, serviceName); + } + + public void flushVnetDnsSetting(String resourceGroupName, String serviceName, Context context) { + this.serviceClient().flushVnetDnsSetting(resourceGroupName, serviceName, context); + } + + public PagedIterable listSupportedApmTypes(String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listSupportedApmTypes(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new SupportedApmTypeImpl(inner1, this.manager())); + } + + public PagedIterable listSupportedApmTypes( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listSupportedApmTypes(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new SupportedApmTypeImpl(inner1, this.manager())); + } + + public Response listGloballyEnabledApmsWithResponse( + String resourceGroupName, String serviceName, Context context) { + Response inner = + this.serviceClient().listGloballyEnabledApmsWithResponse(resourceGroupName, serviceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GloballyEnabledApmsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GloballyEnabledApms listGloballyEnabledApms(String resourceGroupName, String serviceName) { + GloballyEnabledApmsInner inner = this.serviceClient().listGloballyEnabledApms(resourceGroupName, serviceName); + if (inner != null) { + return new GloballyEnabledApmsImpl(inner, this.manager()); + } else { + return null; + } + } + + public void enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm) { + this.serviceClient().enableApmGlobally(resourceGroupName, serviceName, apm); + } + + public void enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context) { + this.serviceClient().enableApmGlobally(resourceGroupName, serviceName, apm, context); + } + + public void disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm) { + this.serviceClient().disableApmGlobally(resourceGroupName, serviceName, apm); + } + + public void disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context) { + this.serviceClient().disableApmGlobally(resourceGroupName, serviceName, apm, context); + } + + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters availabilityParameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, availabilityParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NameAvailability checkNameAvailability(String location, NameAvailabilityParameters availabilityParameters) { + NameAvailabilityInner inner = this.serviceClient().checkNameAvailability(location, availabilityParameters); + if (inner != null) { + return new NameAvailabilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ServiceResourceImpl(inner1, this.manager())); + } + + public PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName) { + PagedIterable inner = + this.serviceClient().listSupportedServerVersions(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new SupportedServerVersionImpl(inner1, this.manager())); + } + + public PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = + this.serviceClient().listSupportedServerVersions(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new SupportedServerVersionImpl(inner1, this.manager())); + } + + public ServiceResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, serviceName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + this.delete(resourceGroupName, serviceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + this.delete(resourceGroupName, serviceName, context); + } + + private ServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public ServiceResourceImpl define(String name) { + return new ServiceResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusClientImpl.java new file mode 100644 index 0000000000000..c373887feda6f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusClientImpl.java @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.SkusClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSkuCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SkusClient. */ +public final class SkusClientImpl implements SkusClient { + /** The proxy service used to perform REST calls. */ + private final SkusService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of SkusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SkusClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(SkusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientSkus to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface SkusService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set 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.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The 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 object that includes an array of Azure Spring Apps SKU and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 object that includes an array of Azure Spring Apps SKU and a possible link for next set along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusImpl.java new file mode 100644 index 0000000000000..98e146bdcfcfb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusImpl.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.appplatform.generated.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.appplatform.generated.fluent.SkusClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner; +import com.azure.resourcemanager.appplatform.generated.models.ResourceSku; +import com.azure.resourcemanager.appplatform.generated.models.Skus; + +public final class SkusImpl implements Skus { + private static final ClientLogger LOGGER = new ClientLogger(SkusImpl.class); + + private final SkusClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public SkusImpl( + SkusClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ResourceSkuImpl(inner1, this.manager())); + } + + private SkusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StorageResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StorageResourceImpl.java new file mode 100644 index 0000000000000..97265098b2180 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StorageResourceImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.StorageProperties; +import com.azure.resourcemanager.appplatform.generated.models.StorageResource; + +public final class StorageResourceImpl implements StorageResource, StorageResource.Definition, StorageResource.Update { + private StorageResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public StorageProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public StorageResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String serviceName; + + private String storageName; + + public StorageResourceImpl withExistingSpring(String resourceGroupName, String serviceName) { + this.resourceGroupName = resourceGroupName; + this.serviceName = serviceName; + return this; + } + + public StorageResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getStorages() + .createOrUpdate(resourceGroupName, serviceName, storageName, this.innerModel(), Context.NONE); + return this; + } + + public StorageResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorages() + .createOrUpdate(resourceGroupName, serviceName, storageName, this.innerModel(), context); + return this; + } + + StorageResourceImpl( + String name, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = new StorageResourceInner(); + this.serviceManager = serviceManager; + this.storageName = name; + } + + public StorageResourceImpl update() { + return this; + } + + public StorageResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getStorages() + .createOrUpdate(resourceGroupName, serviceName, storageName, this.innerModel(), Context.NONE); + return this; + } + + public StorageResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorages() + .createOrUpdate(resourceGroupName, serviceName, storageName, this.innerModel(), context); + return this; + } + + StorageResourceImpl( + StorageResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.serviceName = Utils.getValueFromIdByName(innerObject.id(), "Spring"); + this.storageName = Utils.getValueFromIdByName(innerObject.id(), "storages"); + } + + public StorageResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getStorages() + .getWithResponse(resourceGroupName, serviceName, storageName, Context.NONE) + .getValue(); + return this; + } + + public StorageResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getStorages() + .getWithResponse(resourceGroupName, serviceName, storageName, context) + .getValue(); + return this; + } + + public StorageResourceImpl withProperties(StorageProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesClientImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesClientImpl.java new file mode 100644 index 0000000000000..f5d378ed7dcb0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesClientImpl.java @@ -0,0 +1,1142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appplatform.generated.fluent.StoragesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.StorageResourceCollection; +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 StoragesClient. */ +public final class StoragesClientImpl implements StoragesClient { + /** The proxy service used to perform REST calls. */ + private final StoragesService service; + + /** The service client containing this operation class. */ + private final AppPlatformManagementClientImpl client; + + /** + * Initializes an instance of StoragesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StoragesClientImpl(AppPlatformManagementClientImpl client) { + this.service = RestProxy.create(StoragesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AppPlatformManagementClientStorages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AppPlatformManagemen") + public interface StoragesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("storageName") String storageName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("storageName") String storageName, + @BodyParam("application/json") StorageResourceInner storageResource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @PathParam("storageName") String storageName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String storageName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (storageName == null) { + return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + storageName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String serviceName, String storageName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (storageName == null) { + return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + storageName, + accept, + context); + } + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String serviceName, String storageName) { + return getWithResponseAsync(resourceGroupName, serviceName, storageName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String serviceName, String storageName, Context context) { + return getWithResponseAsync(resourceGroupName, serviceName, storageName, context).block(); + } + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageResourceInner get(String resourceGroupName, String serviceName, String storageName) { + return getWithResponse(resourceGroupName, serviceName, storageName, Context.NONE).getValue(); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (storageName == null) { + return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); + } + if (storageResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageResource is required and cannot be null.")); + } else { + storageResource.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + storageName, + storageResource, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (storageName == null) { + return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); + } + if (storageResource == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageResource is required and cannot be null.")); + } else { + storageResource.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + storageName, + storageResource, + accept, + context); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, storageName, storageResource); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + StorageResourceInner.class, + StorageResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of storage resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, serviceName, storageName, storageResource, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), StorageResourceInner.class, StorageResourceInner.class, context); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 storage resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, storageName, storageResource) + .getSyncPoller(); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of storage resource payload. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context) { + return this + .beginCreateOrUpdateAsync(resourceGroupName, serviceName, storageName, storageResource, context) + .getSyncPoller(); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, storageName, storageResource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, serviceName, storageName, storageResource, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageResourceInner createOrUpdate( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource) { + return createOrUpdateAsync(resourceGroupName, serviceName, storageName, storageResource).block(); + } + + /** + * Create or update storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param storageResource Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage resource payload. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageResourceInner createOrUpdate( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context) { + return createOrUpdateAsync(resourceGroupName, serviceName, storageName, storageResource, context).block(); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String storageName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (storageName == null) { + return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + storageName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String serviceName, String storageName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + if (storageName == null) { + return Mono.error(new IllegalArgumentException("Parameter storageName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + storageName, + accept, + context); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String storageName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, serviceName, storageName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String serviceName, String storageName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, serviceName, storageName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String storageName) { + return this.beginDeleteAsync(resourceGroupName, serviceName, storageName).getSyncPoller(); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String storageName, Context context) { + return this.beginDeleteAsync(resourceGroupName, serviceName, storageName, context).getSyncPoller(); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String storageName) { + return beginDeleteAsync(resourceGroupName, serviceName, storageName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String serviceName, String storageName, Context context) { + return beginDeleteAsync(resourceGroupName, serviceName, storageName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String storageName) { + deleteAsync(resourceGroupName, serviceName, storageName).block(); + } + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String serviceName, String storageName, Context context) { + deleteAsync(resourceGroupName, serviceName, storageName, context).block(); + } + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName) { + 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String serviceName, 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 (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + serviceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); + } + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, 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 collection compose of storage resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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 collection compose of storage resources list and a possible link for next page along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesImpl.java new file mode 100644 index 0000000000000..1b5df11145f32 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesImpl.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.appplatform.generated.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.appplatform.generated.fluent.StoragesClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.StorageResource; +import com.azure.resourcemanager.appplatform.generated.models.Storages; + +public final class StoragesImpl implements Storages { + private static final ClientLogger LOGGER = new ClientLogger(StoragesImpl.class); + + private final StoragesClient innerClient; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + public StoragesImpl( + StoragesClient innerClient, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String serviceName, String storageName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, serviceName, storageName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new StorageResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageResource get(String resourceGroupName, String serviceName, String storageName) { + StorageResourceInner inner = this.serviceClient().get(resourceGroupName, serviceName, storageName); + if (inner != null) { + return new StorageResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String serviceName, String storageName) { + this.serviceClient().delete(resourceGroupName, serviceName, storageName); + } + + public void delete(String resourceGroupName, String serviceName, String storageName, Context context) { + this.serviceClient().delete(resourceGroupName, serviceName, storageName, context); + } + + public PagedIterable list(String resourceGroupName, String serviceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); + return Utils.mapPage(inner, inner1 -> new StorageResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName, context); + return Utils.mapPage(inner, inner1 -> new StorageResourceImpl(inner1, this.manager())); + } + + public StorageResource 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String storageName = Utils.getValueFromIdByName(id, "storages"); + if (storageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, storageName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String storageName = Utils.getValueFromIdByName(id, "storages"); + if (storageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.getWithResponse(resourceGroupName, serviceName, storageName, 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 serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String storageName = Utils.getValueFromIdByName(id, "storages"); + if (storageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + this.delete(resourceGroupName, serviceName, storageName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String serviceName = Utils.getValueFromIdByName(id, "Spring"); + if (serviceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'Spring'.", id))); + } + String storageName = Utils.getValueFromIdByName(id, "storages"); + if (storageName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + this.delete(resourceGroupName, serviceName, storageName, context); + } + + private StoragesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public StorageResourceImpl define(String name) { + return new StorageResourceImpl(name, this.manager()); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedApmTypeImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedApmTypeImpl.java new file mode 100644 index 0000000000000..bc4534e73e2cc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedApmTypeImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner; +import com.azure.resourcemanager.appplatform.generated.models.SupportedApmType; + +public final class SupportedApmTypeImpl implements SupportedApmType { + private SupportedApmTypeInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + SupportedApmTypeImpl( + SupportedApmTypeInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public SupportedApmTypeInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedBuildpackResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedBuildpackResourceImpl.java new file mode 100644 index 0000000000000..aa0db6eacab61 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedBuildpackResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpackResource; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpackResourceProperties; + +public final class SupportedBuildpackResourceImpl implements SupportedBuildpackResource { + private SupportedBuildpackResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + SupportedBuildpackResourceImpl( + SupportedBuildpackResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 SupportedBuildpackResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SupportedBuildpackResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedBuildpacksCollectionImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedBuildpacksCollectionImpl.java new file mode 100644 index 0000000000000..302378f36d0e4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedBuildpacksCollectionImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpackResource; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpacksCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SupportedBuildpacksCollectionImpl implements SupportedBuildpacksCollection { + private SupportedBuildpacksCollectionInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + SupportedBuildpacksCollectionImpl( + SupportedBuildpacksCollectionInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 SupportedBuildpackResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public SupportedBuildpacksCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedServerVersionImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedServerVersionImpl.java new file mode 100644 index 0000000000000..9bbd6322fb56d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedServerVersionImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner; +import com.azure.resourcemanager.appplatform.generated.models.SupportedServerVersion; + +public final class SupportedServerVersionImpl implements SupportedServerVersion { + private SupportedServerVersionInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + SupportedServerVersionImpl( + SupportedServerVersionInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String value() { + return this.innerModel().value(); + } + + public String server() { + return this.innerModel().server(); + } + + public String version() { + return this.innerModel().version(); + } + + public SupportedServerVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedStackResourceImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedStackResourceImpl.java new file mode 100644 index 0000000000000..660965875c863 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedStackResourceImpl.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.appplatform.generated.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStackResource; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStackResourceProperties; + +public final class SupportedStackResourceImpl implements SupportedStackResource { + private SupportedStackResourceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + SupportedStackResourceImpl( + SupportedStackResourceInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 SupportedStackResourceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SupportedStackResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedStacksCollectionImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedStacksCollectionImpl.java new file mode 100644 index 0000000000000..e9368dff358c9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SupportedStacksCollectionImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStacksCollectionInner; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStackResource; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStacksCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class SupportedStacksCollectionImpl implements SupportedStacksCollection { + private SupportedStacksCollectionInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + SupportedStacksCollectionImpl( + SupportedStacksCollectionInner innerObject, + com.azure.resourcemanager.appplatform.generated.AppPlatformManager 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 SupportedStackResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public SupportedStacksCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/TestKeysImpl.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/TestKeysImpl.java new file mode 100644 index 0000000000000..94d0632c856d0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/TestKeysImpl.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.appplatform.generated.implementation; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.TestKeys; + +public final class TestKeysImpl implements TestKeys { + private TestKeysInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + TestKeysImpl( + TestKeysInner innerObject, com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public String primaryTestEndpoint() { + return this.innerModel().primaryTestEndpoint(); + } + + public String secondaryTestEndpoint() { + return this.innerModel().secondaryTestEndpoint(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public TestKeysInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/Utils.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/Utils.java new file mode 100644 index 0000000000000..99086f357e796 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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.appplatform.generated.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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/package-info.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/package-info.java new file mode 100644 index 0000000000000..adefc664d75d9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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 AppPlatformManagementClient. REST API for Azure Spring Apps. */ +package com.azure.resourcemanager.appplatform.generated.implementation; diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorAuthSetting.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorAuthSetting.java new file mode 100644 index 0000000000000..e9c743628c29a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorAuthSetting.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Auth setting payload. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "authType", + defaultImpl = AcceleratorAuthSetting.class) +@JsonTypeName("AcceleratorAuthSetting") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Public", value = AcceleratorPublicSetting.class), + @JsonSubTypes.Type(name = "BasicAuth", value = AcceleratorBasicAuthSetting.class), + @JsonSubTypes.Type(name = "SSH", value = AcceleratorSshSetting.class) +}) +@Immutable +public class AcceleratorAuthSetting { + /** Creates an instance of AcceleratorAuthSetting class. */ + public AcceleratorAuthSetting() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorBasicAuthSetting.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorBasicAuthSetting.java new file mode 100644 index 0000000000000..37aa68a9d3c56 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorBasicAuthSetting.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Auth setting for basic auth. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("BasicAuth") +@Fluent +public final class AcceleratorBasicAuthSetting extends AcceleratorAuthSetting { + /* + * Resource Id of CA certificate for https URL of Git repository. + */ + @JsonProperty(value = "caCertResourceId") + private String caCertResourceId; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of AcceleratorBasicAuthSetting class. */ + public AcceleratorBasicAuthSetting() { + } + + /** + * Get the caCertResourceId property: Resource Id of CA certificate for https URL of Git repository. + * + * @return the caCertResourceId value. + */ + public String caCertResourceId() { + return this.caCertResourceId; + } + + /** + * Set the caCertResourceId property: Resource Id of CA certificate for https URL of Git repository. + * + * @param caCertResourceId the caCertResourceId value to set. + * @return the AcceleratorBasicAuthSetting object itself. + */ + public AcceleratorBasicAuthSetting withCaCertResourceId(String caCertResourceId) { + this.caCertResourceId = caCertResourceId; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the AcceleratorBasicAuthSetting object itself. + */ + public AcceleratorBasicAuthSetting withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the AcceleratorBasicAuthSetting object itself. + */ + public AcceleratorBasicAuthSetting withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model AcceleratorBasicAuthSetting")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AcceleratorBasicAuthSetting.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorGitRepository.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorGitRepository.java new file mode 100644 index 0000000000000..8bbb2e307afe7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorGitRepository.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AcceleratorGitRepository model. */ +@Fluent +public final class AcceleratorGitRepository { + /* + * Git repository URL for the accelerator. + */ + @JsonProperty(value = "url", required = true) + private String url; + + /* + * Interval for checking for updates to Git or image repository. + */ + @JsonProperty(value = "intervalInSeconds") + private Integer intervalInSeconds; + + /* + * Git repository branch to be used. + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * Git repository commit to be used. + */ + @JsonProperty(value = "commit") + private String commit; + + /* + * Git repository tag to be used. + */ + @JsonProperty(value = "gitTag") + private String gitTag; + + /* + * Properties of the auth setting payload. + */ + @JsonProperty(value = "authSetting", required = true) + private AcceleratorAuthSetting authSetting; + + /* + * Folder path inside the git repository to consider as the root of the accelerator or fragment. + */ + @JsonProperty(value = "subPath") + private String subPath; + + /** Creates an instance of AcceleratorGitRepository class. */ + public AcceleratorGitRepository() { + } + + /** + * Get the url property: Git repository URL for the accelerator. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Git repository URL for the accelerator. + * + * @param url the url value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the intervalInSeconds property: Interval for checking for updates to Git or image repository. + * + * @return the intervalInSeconds value. + */ + public Integer intervalInSeconds() { + return this.intervalInSeconds; + } + + /** + * Set the intervalInSeconds property: Interval for checking for updates to Git or image repository. + * + * @param intervalInSeconds the intervalInSeconds value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withIntervalInSeconds(Integer intervalInSeconds) { + this.intervalInSeconds = intervalInSeconds; + return this; + } + + /** + * Get the branch property: Git repository branch to be used. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: Git repository branch to be used. + * + * @param branch the branch value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the commit property: Git repository commit to be used. + * + * @return the commit value. + */ + public String commit() { + return this.commit; + } + + /** + * Set the commit property: Git repository commit to be used. + * + * @param commit the commit value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withCommit(String commit) { + this.commit = commit; + return this; + } + + /** + * Get the gitTag property: Git repository tag to be used. + * + * @return the gitTag value. + */ + public String gitTag() { + return this.gitTag; + } + + /** + * Set the gitTag property: Git repository tag to be used. + * + * @param gitTag the gitTag value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withGitTag(String gitTag) { + this.gitTag = gitTag; + return this; + } + + /** + * Get the authSetting property: Properties of the auth setting payload. + * + * @return the authSetting value. + */ + public AcceleratorAuthSetting authSetting() { + return this.authSetting; + } + + /** + * Set the authSetting property: Properties of the auth setting payload. + * + * @param authSetting the authSetting value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withAuthSetting(AcceleratorAuthSetting authSetting) { + this.authSetting = authSetting; + return this; + } + + /** + * Get the subPath property: Folder path inside the git repository to consider as the root of the accelerator or + * fragment. + * + * @return the subPath value. + */ + public String subPath() { + return this.subPath; + } + + /** + * Set the subPath property: Folder path inside the git repository to consider as the root of the accelerator or + * fragment. + * + * @param subPath the subPath value to set. + * @return the AcceleratorGitRepository object itself. + */ + public AcceleratorGitRepository withSubPath(String subPath) { + this.subPath = subPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (url() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property url in model AcceleratorGitRepository")); + } + if (authSetting() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authSetting in model AcceleratorGitRepository")); + } else { + authSetting().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AcceleratorGitRepository.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorPublicSetting.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorPublicSetting.java new file mode 100644 index 0000000000000..e791cf136fba3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorPublicSetting.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Auth setting for public url. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("Public") +@Fluent +public final class AcceleratorPublicSetting extends AcceleratorAuthSetting { + /* + * Resource Id of CA certificate for https URL of Git repository. + */ + @JsonProperty(value = "caCertResourceId") + private String caCertResourceId; + + /** Creates an instance of AcceleratorPublicSetting class. */ + public AcceleratorPublicSetting() { + } + + /** + * Get the caCertResourceId property: Resource Id of CA certificate for https URL of Git repository. + * + * @return the caCertResourceId value. + */ + public String caCertResourceId() { + return this.caCertResourceId; + } + + /** + * Set the caCertResourceId property: Resource Id of CA certificate for https URL of Git repository. + * + * @param caCertResourceId the caCertResourceId value to set. + * @return the AcceleratorPublicSetting object itself. + */ + public AcceleratorPublicSetting withCaCertResourceId(String caCertResourceId) { + this.caCertResourceId = caCertResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorSshSetting.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorSshSetting.java new file mode 100644 index 0000000000000..7be0aeecdc736 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AcceleratorSshSetting.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Auth setting for SSH auth. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authType") +@JsonTypeName("SSH") +@Fluent +public final class AcceleratorSshSetting extends AcceleratorAuthSetting { + /* + * Public SSH Key of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SSH Key algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private SSH Key algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /** Creates an instance of AcceleratorSshSetting class. */ + public AcceleratorSshSetting() { + } + + /** + * Get the hostKey property: Public SSH Key of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public SSH Key of git repository. + * + * @param hostKey the hostKey value to set. + * @return the AcceleratorSshSetting object itself. + */ + public AcceleratorSshSetting withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SSH Key algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SSH Key algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the AcceleratorSshSetting object itself. + */ + public AcceleratorSshSetting withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private SSH Key algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private SSH Key algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the AcceleratorSshSetting object itself. + */ + public AcceleratorSshSetting withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ActionType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ActionType.java new file mode 100644 index 0000000000000..87e3d8d7c48f7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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.appplatform.generated.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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ActiveDeploymentCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ActiveDeploymentCollection.java new file mode 100644 index 0000000000000..268e1b54dde84 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ActiveDeploymentCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Deployment resource name and set them as active. */ +@Fluent +public final class ActiveDeploymentCollection { + /* + * Collection of Deployment name. + */ + @JsonProperty(value = "activeDeploymentNames") + private List activeDeploymentNames; + + /** Creates an instance of ActiveDeploymentCollection class. */ + public ActiveDeploymentCollection() { + } + + /** + * Get the activeDeploymentNames property: Collection of Deployment name. + * + * @return the activeDeploymentNames value. + */ + public List activeDeploymentNames() { + return this.activeDeploymentNames; + } + + /** + * Set the activeDeploymentNames property: Collection of Deployment name. + * + * @param activeDeploymentNames the activeDeploymentNames value to set. + * @return the ActiveDeploymentCollection object itself. + */ + public ActiveDeploymentCollection withActiveDeploymentNames(List activeDeploymentNames) { + this.activeDeploymentNames = activeDeploymentNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainProperties.java new file mode 100644 index 0000000000000..dbe4414151ba2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of custom domain for API portal. */ +@Fluent +public final class ApiPortalCustomDomainProperties { + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** Creates an instance of ApiPortalCustomDomainProperties class. */ + public ApiPortalCustomDomainProperties() { + } + + /** + * Get the thumbprint property: The thumbprint of bound certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of bound certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the ApiPortalCustomDomainProperties object itself. + */ + public ApiPortalCustomDomainProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResource.java new file mode 100644 index 0000000000000..e9f69bb41a6f2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; + +/** An immutable client-side representation of ApiPortalCustomDomainResource. */ +public interface ApiPortalCustomDomainResource { + /** + * 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 properties property: The properties of custom domain for API portal. + * + * @return the properties value. + */ + ApiPortalCustomDomainProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner + * object. + * + * @return the inner object. + */ + ApiPortalCustomDomainResourceInner innerModel(); + + /** The entirety of the ApiPortalCustomDomainResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ApiPortalCustomDomainResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApiPortalCustomDomainResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ApiPortalCustomDomainResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, apiPortalName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @return the next definition stage. + */ + WithCreate withExistingApiPortal(String resourceGroupName, String serviceName, String apiPortalName); + } + + /** + * The stage of the ApiPortalCustomDomainResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiPortalCustomDomainResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiPortalCustomDomainResource create(Context context); + } + + /** The stage of the ApiPortalCustomDomainResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of custom domain for API portal. + * + * @param properties The properties of custom domain for API portal. + * @return the next definition stage. + */ + WithCreate withProperties(ApiPortalCustomDomainProperties properties); + } + } + + /** + * Begins update for the ApiPortalCustomDomainResource resource. + * + * @return the stage of resource update. + */ + ApiPortalCustomDomainResource.Update update(); + + /** The template for ApiPortalCustomDomainResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiPortalCustomDomainResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiPortalCustomDomainResource apply(Context context); + } + + /** The ApiPortalCustomDomainResource update stages. */ + interface UpdateStages { + /** The stage of the ApiPortalCustomDomainResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of custom domain for API portal. + * + * @param properties The properties of custom domain for API portal. + * @return the next definition stage. + */ + Update withProperties(ApiPortalCustomDomainProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiPortalCustomDomainResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiPortalCustomDomainResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResourceCollection.java new file mode 100644 index 0000000000000..fa35a40aadd3c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of API portal custom domain resources and a possible link for next set. */ +@Fluent +public final class ApiPortalCustomDomainResourceCollection { + /* + * Collection of API portal custom domain resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApiPortalCustomDomainResourceCollection class. */ + public ApiPortalCustomDomainResourceCollection() { + } + + /** + * Get the value property: Collection of API portal custom domain resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of API portal custom domain resources. + * + * @param value the value value to set. + * @return the ApiPortalCustomDomainResourceCollection object itself. + */ + public ApiPortalCustomDomainResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ApiPortalCustomDomainResourceCollection object itself. + */ + public ApiPortalCustomDomainResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomains.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomains.java new file mode 100644 index 0000000000000..cbe308ac1152c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomains.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApiPortalCustomDomains. */ +public interface ApiPortalCustomDomains { + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @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 API portal custom domain along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, Context context); + + /** + * Get the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal custom domain. + */ + ApiPortalCustomDomainResource get( + String resourceGroupName, String serviceName, String apiPortalName, String domainName); + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiPortalName, String domainName); + + /** + * Delete the API portal custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param domainName The name of the API portal custom domain. + * @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 serviceName, String apiPortalName, String domainName, Context context); + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName); + + /** + * Handle requests to list all API portal custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 object that includes an array of API portal custom domain resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String apiPortalName, Context context); + + /** + * Get the API portal custom domain. + * + * @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 API portal custom domain along with {@link Response}. + */ + ApiPortalCustomDomainResource getById(String id); + + /** + * Get the API portal custom domain. + * + * @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 API portal custom domain along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the API portal custom domain. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the API portal custom domain. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApiPortalCustomDomainResource resource. + * + * @param name resource name. + * @return the first stage of the new ApiPortalCustomDomainResource definition. + */ + ApiPortalCustomDomainResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalInstance.java new file mode 100644 index 0000000000000..e365f9e59d9ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the API portal. */ +@Immutable +public final class ApiPortalInstance { + /* + * Name of the API portal instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the API portal instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ApiPortalInstance class. */ + public ApiPortalInstance() { + } + + /** + * Get the name property: Name of the API portal instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the API portal instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProperties.java new file mode 100644 index 0000000000000..199df59a16d33 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProperties.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API portal properties payload. */ +@Fluent +public final class ApiPortalProperties { + /* + * State of the API portal. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ApiPortalProvisioningState provisioningState; + + /* + * Indicates whether the API portal exposes endpoint. + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /* + * URL of the API portal, exposed when 'public' is true. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Indicate if only https is allowed. + */ + @JsonProperty(value = "httpsOnly") + private Boolean httpsOnly; + + /* + * The array of resource Ids of gateway to integrate with API portal. + */ + @JsonProperty(value = "gatewayIds") + private List gatewayIds; + + /* + * Collection of OpenAPI source URL locations. + */ + @JsonProperty(value = "sourceUrls") + private List sourceUrls; + + /* + * Single sign-on related configuration + */ + @JsonProperty(value = "ssoProperties") + private SsoProperties ssoProperties; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests", access = JsonProperty.Access.WRITE_ONLY) + private ApiPortalResourceRequests resourceRequests; + + /* + * Collection of instances belong to API portal. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of ApiPortalProperties class. */ + public ApiPortalProperties() { + } + + /** + * Get the provisioningState property: State of the API portal. + * + * @return the provisioningState value. + */ + public ApiPortalProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicProperty property: Indicates whether the API portal exposes endpoint. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: Indicates whether the API portal exposes endpoint. + * + * @param publicProperty the publicProperty value to set. + * @return the ApiPortalProperties object itself. + */ + public ApiPortalProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the url property: URL of the API portal, exposed when 'public' is true. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the httpsOnly property: Indicate if only https is allowed. + * + * @return the httpsOnly value. + */ + public Boolean httpsOnly() { + return this.httpsOnly; + } + + /** + * Set the httpsOnly property: Indicate if only https is allowed. + * + * @param httpsOnly the httpsOnly value to set. + * @return the ApiPortalProperties object itself. + */ + public ApiPortalProperties withHttpsOnly(Boolean httpsOnly) { + this.httpsOnly = httpsOnly; + return this; + } + + /** + * Get the gatewayIds property: The array of resource Ids of gateway to integrate with API portal. + * + * @return the gatewayIds value. + */ + public List gatewayIds() { + return this.gatewayIds; + } + + /** + * Set the gatewayIds property: The array of resource Ids of gateway to integrate with API portal. + * + * @param gatewayIds the gatewayIds value to set. + * @return the ApiPortalProperties object itself. + */ + public ApiPortalProperties withGatewayIds(List gatewayIds) { + this.gatewayIds = gatewayIds; + return this; + } + + /** + * Get the sourceUrls property: Collection of OpenAPI source URL locations. + * + * @return the sourceUrls value. + */ + public List sourceUrls() { + return this.sourceUrls; + } + + /** + * Set the sourceUrls property: Collection of OpenAPI source URL locations. + * + * @param sourceUrls the sourceUrls value to set. + * @return the ApiPortalProperties object itself. + */ + public ApiPortalProperties withSourceUrls(List sourceUrls) { + this.sourceUrls = sourceUrls; + return this; + } + + /** + * Get the ssoProperties property: Single sign-on related configuration. + * + * @return the ssoProperties value. + */ + public SsoProperties ssoProperties() { + return this.ssoProperties; + } + + /** + * Set the ssoProperties property: Single sign-on related configuration. + * + * @param ssoProperties the ssoProperties value to set. + * @return the ApiPortalProperties object itself. + */ + public ApiPortalProperties withSsoProperties(SsoProperties ssoProperties) { + this.ssoProperties = ssoProperties; + return this; + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public ApiPortalResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Get the instances property: Collection of instances belong to API portal. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssoProperties() != null) { + ssoProperties().validate(); + } + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProvisioningState.java new file mode 100644 index 0000000000000..337d49056ec4f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the API portal. */ +public final class ApiPortalProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ApiPortalProvisioningState. */ + public static final ApiPortalProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ApiPortalProvisioningState. */ + public static final ApiPortalProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ApiPortalProvisioningState. */ + public static final ApiPortalProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ApiPortalProvisioningState. */ + public static final ApiPortalProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ApiPortalProvisioningState. */ + public static final ApiPortalProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ApiPortalProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApiPortalProvisioningState() { + } + + /** + * Creates or finds a ApiPortalProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApiPortalProvisioningState. + */ + @JsonCreator + public static ApiPortalProvisioningState fromString(String name) { + return fromString(name, ApiPortalProvisioningState.class); + } + + /** + * Gets known ApiPortalProvisioningState values. + * + * @return known ApiPortalProvisioningState values. + */ + public static Collection values() { + return values(ApiPortalProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResource.java new file mode 100644 index 0000000000000..2c0632f55b6be --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResource.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner; + +/** An immutable client-side representation of ApiPortalResource. */ +public interface ApiPortalResource { + /** + * 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 properties property: API portal properties payload. + * + * @return the properties value. + */ + ApiPortalProperties properties(); + + /** + * Gets the sku property: Sku of the API portal 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner object. + * + * @return the inner object. + */ + ApiPortalResourceInner innerModel(); + + /** The entirety of the ApiPortalResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ApiPortalResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApiPortalResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ApiPortalResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the ApiPortalResource 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.WithProperties, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApiPortalResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApiPortalResource create(Context context); + } + + /** The stage of the ApiPortalResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: API portal properties payload. + * + * @param properties API portal properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(ApiPortalProperties properties); + } + + /** The stage of the ApiPortalResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the API portal resource. + * + * @param sku Sku of the API portal resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the ApiPortalResource resource. + * + * @return the stage of resource update. + */ + ApiPortalResource.Update update(); + + /** The template for ApiPortalResource update. */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApiPortalResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApiPortalResource apply(Context context); + } + + /** The ApiPortalResource update stages. */ + interface UpdateStages { + /** The stage of the ApiPortalResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: API portal properties payload. + * + * @param properties API portal properties payload. + * @return the next definition stage. + */ + Update withProperties(ApiPortalProperties properties); + } + + /** The stage of the ApiPortalResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the API portal resource. + * + * @param sku Sku of the API portal resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApiPortalResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApiPortalResource refresh(Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResourceCollection.java new file mode 100644 index 0000000000000..d3f95d1c6d08f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of API portal resources and a possible link for next set. */ +@Fluent +public final class ApiPortalResourceCollection { + /* + * Collection of API portal resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApiPortalResourceCollection class. */ + public ApiPortalResourceCollection() { + } + + /** + * Get the value property: Collection of API portal resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of API portal resources. + * + * @param value the value value to set. + * @return the ApiPortalResourceCollection object itself. + */ + public ApiPortalResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ApiPortalResourceCollection object itself. + */ + public ApiPortalResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResourceRequests.java new file mode 100644 index 0000000000000..d66c36e429a7f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResourceRequests.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource requests of the API portal. */ +@Immutable +public final class ApiPortalResourceRequests { + /* + * Cpu allocated to each API portal instance + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory allocated to each API portal instance + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /** Creates an instance of ApiPortalResourceRequests class. */ + public ApiPortalResourceRequests() { + } + + /** + * Get the cpu property: Cpu allocated to each API portal instance. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory allocated to each API portal instance. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortals.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortals.java new file mode 100644 index 0000000000000..53c7d024d40d6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortals.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApiPortals. */ +public interface ApiPortals { + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 API portal and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apiPortalName, Context context); + + /** + * Get the API portal and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the API portal and its properties. + */ + ApiPortalResource get(String resourceGroupName, String serviceName, String apiPortalName); + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apiPortalName); + + /** + * Delete the default API portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @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 serviceName, String apiPortalName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of API portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload, + Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apiPortalName The name of API portal. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + CustomDomainValidateResult validateDomain( + String resourceGroupName, + String serviceName, + String apiPortalName, + CustomDomainValidatePayload validatePayload); + + /** + * Get the API portal and its properties. + * + * @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 API portal and its properties along with {@link Response}. + */ + ApiPortalResource getById(String id); + + /** + * Get the API portal and its properties. + * + * @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 API portal and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the default API portal. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the default API portal. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApiPortalResource resource. + * + * @param name resource name. + * @return the first stage of the new ApiPortalResource definition. + */ + ApiPortalResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmProperties.java new file mode 100644 index 0000000000000..f480fd2c83ea1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties of an APM. */ +@Fluent +public final class ApmProperties { + /* + * APM Type + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * State of the APM. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ApmProvisioningState provisioningState; + + /* + * Non-sensitive properties for the APM + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /* + * Sensitive properties for the APM + */ + @JsonProperty(value = "secrets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map secrets; + + /** Creates an instance of ApmProperties class. */ + public ApmProperties() { + } + + /** + * Get the type property: APM Type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: APM Type. + * + * @param type the type value to set. + * @return the ApmProperties object itself. + */ + public ApmProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the provisioningState property: State of the APM. + * + * @return the provisioningState value. + */ + public ApmProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the properties property: Non-sensitive properties for the APM. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Non-sensitive properties for the APM. + * + * @param properties the properties value to set. + * @return the ApmProperties object itself. + */ + public ApmProperties withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the secrets property: Sensitive properties for the APM. + * + * @return the secrets value. + */ + public Map secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Sensitive properties for the APM. + * + * @param secrets the secrets value to set. + * @return the ApmProperties object itself. + */ + public ApmProperties withSecrets(Map secrets) { + this.secrets = secrets; + 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 ApmProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApmProperties.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmProvisioningState.java new file mode 100644 index 0000000000000..2482065bb5b04 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the APM. */ +public final class ApmProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ApmProvisioningState. */ + public static final ApmProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ApmProvisioningState. */ + public static final ApmProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ApmProvisioningState. */ + public static final ApmProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ApmProvisioningState. */ + public static final ApmProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ApmProvisioningState. */ + public static final ApmProvisioningState DELETING = fromString("Deleting"); + + /** Static value Canceled for ApmProvisioningState. */ + public static final ApmProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ApmProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApmProvisioningState() { + } + + /** + * Creates or finds a ApmProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApmProvisioningState. + */ + @JsonCreator + public static ApmProvisioningState fromString(String name) { + return fromString(name, ApmProvisioningState.class); + } + + /** + * Gets known ApmProvisioningState values. + * + * @return known ApmProvisioningState values. + */ + public static Collection values() { + return values(ApmProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmReference.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmReference.java new file mode 100644 index 0000000000000..eecd28be4921f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmReference.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A reference to the APM. */ +@Fluent +public final class ApmReference { + /* + * Resource Id of the APM + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** Creates an instance of ApmReference class. */ + public ApmReference() { + } + + /** + * Get the resourceId property: Resource Id of the APM. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id of the APM. + * + * @param resourceId the resourceId value to set. + * @return the ApmReference object itself. + */ + public ApmReference withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model ApmReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApmReference.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmResource.java new file mode 100644 index 0000000000000..ab0bb964240f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmResource.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.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmResourceInner; + +/** An immutable client-side representation of ApmResource. */ +public interface ApmResource { + /** + * 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 properties property: Properties of an APM. + * + * @return the properties value. + */ + ApmProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ApmResourceInner object. + * + * @return the inner object. + */ + ApmResourceInner innerModel(); + + /** The entirety of the ApmResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ApmResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApmResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ApmResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the ApmResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApmResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApmResource create(Context context); + } + + /** The stage of the ApmResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of an APM. + * + * @param properties Properties of an APM. + * @return the next definition stage. + */ + WithCreate withProperties(ApmProperties properties); + } + } + + /** + * Begins update for the ApmResource resource. + * + * @return the stage of resource update. + */ + ApmResource.Update update(); + + /** The template for ApmResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApmResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApmResource apply(Context context); + } + + /** The ApmResource update stages. */ + interface UpdateStages { + /** The stage of the ApmResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of an APM. + * + * @param properties Properties of an APM. + * @return the next definition stage. + */ + Update withProperties(ApmProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApmResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApmResource refresh(Context context); + + /** + * List keys of APM sensitive properties. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties along with {@link Response}. + */ + Response listSecretKeysWithResponse(Context context); + + /** + * List keys of APM sensitive properties. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties. + */ + ApmSecretKeys listSecretKeys(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmResourceCollection.java new file mode 100644 index 0000000000000..5e32309a99404 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of APM resources and a possible link for next set. */ +@Fluent +public final class ApmResourceCollection { + /* + * Collection of APM resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApmResourceCollection class. */ + public ApmResourceCollection() { + } + + /** + * Get the value property: Collection of APM resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of APM resources. + * + * @param value the value value to set. + * @return the ApmResourceCollection object itself. + */ + public ApmResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ApmResourceCollection object itself. + */ + public ApmResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmSecretKeys.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmSecretKeys.java new file mode 100644 index 0000000000000..13792e817be05 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmSecretKeys.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApmSecretKeysInner; +import java.util.List; + +/** An immutable client-side representation of ApmSecretKeys. */ +public interface ApmSecretKeys { + /** + * Gets the value property: Collection of the keys for the APM sensitive properties. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ApmSecretKeysInner object. + * + * @return the inner object. + */ + ApmSecretKeysInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmType.java new file mode 100644 index 0000000000000..e39689d78e6d4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApmType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of application performance monitoring. */ +public final class ApmType extends ExpandableStringEnum { + /** Static value ApplicationInsights for ApmType. */ + public static final ApmType APPLICATION_INSIGHTS = fromString("ApplicationInsights"); + + /** Static value AppDynamics for ApmType. */ + public static final ApmType APP_DYNAMICS = fromString("AppDynamics"); + + /** Static value Dynatrace for ApmType. */ + public static final ApmType DYNATRACE = fromString("Dynatrace"); + + /** Static value NewRelic for ApmType. */ + public static final ApmType NEW_RELIC = fromString("NewRelic"); + + /** Static value ElasticAPM for ApmType. */ + public static final ApmType ELASTIC_APM = fromString("ElasticAPM"); + + /** + * Creates a new instance of ApmType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApmType() { + } + + /** + * Creates or finds a ApmType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApmType. + */ + @JsonCreator + public static ApmType fromString(String name) { + return fromString(name, ApmType.class); + } + + /** + * Gets known ApmType values. + * + * @return known ApmType values. + */ + public static Collection values() { + return values(ApmType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apms.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apms.java new file mode 100644 index 0000000000000..50070e1b10080 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apms.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Apms. */ +public interface Apms { + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Get collection of APMs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of APMs as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 APM by name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context); + + /** + * Get the APM by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name. + */ + ApmResource get(String resourceGroupName, String serviceName, String apmName); + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String apmName); + + /** + * Operation to delete an APM. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 serviceName, String apmName, Context context); + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @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 keys of APM sensitive properties along with {@link Response}. + */ + Response listSecretKeysWithResponse( + String resourceGroupName, String serviceName, String apmName, Context context); + + /** + * List keys of APM sensitive properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apmName The name of the APM. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return keys of APM sensitive properties. + */ + ApmSecretKeys listSecretKeys(String resourceGroupName, String serviceName, String apmName); + + /** + * Get the APM by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name along with {@link Response}. + */ + ApmResource getById(String id); + + /** + * Get the APM by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the APM by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete an APM. + * + * @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); + + /** + * Operation to delete an APM. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApmResource resource. + * + * @param name resource name. + * @return the first stage of the new ApmResource definition. + */ + ApmResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResource.java new file mode 100644 index 0000000000000..84d90b9908c91 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResource.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.AppResourceInner; + +/** An immutable client-side representation of AppResource. */ +public interface AppResource { + /** + * 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 properties property: Properties of the App resource. + * + * @return the properties value. + */ + AppResourceProperties properties(); + + /** + * Gets the identity property: The Managed Identity type of the app resource. + * + * @return the identity value. + */ + ManagedIdentityProperties identity(); + + /** + * Gets the location property: The GEO location of the application, always the same with its parent resource. + * + * @return the location value. + */ + String location(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.AppResourceInner object. + * + * @return the inner object. + */ + AppResourceInner innerModel(); + + /** The entirety of the AppResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The AppResource definition stages. */ + interface DefinitionStages { + /** The first stage of the AppResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the AppResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the AppResource 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.WithLocation, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { + /** + * Executes the create request. + * + * @return the created resource. + */ + AppResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AppResource create(Context context); + } + + /** The stage of the AppResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The GEO location of the application, always the same with its parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The GEO location of the application, always the same with its parent resource. + * @return the next definition stage. + */ + WithCreate withRegion(String location); + } + + /** The stage of the AppResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the App resource. + * + * @param properties Properties of the App resource. + * @return the next definition stage. + */ + WithCreate withProperties(AppResourceProperties properties); + } + + /** The stage of the AppResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The Managed Identity type of the app resource. + * + * @param identity The Managed Identity type of the app resource. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedIdentityProperties identity); + } + } + + /** + * Begins update for the AppResource resource. + * + * @return the stage of resource update. + */ + AppResource.Update update(); + + /** The template for AppResource update. */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithIdentity { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AppResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AppResource apply(Context context); + } + + /** The AppResource update stages. */ + interface UpdateStages { + /** The stage of the AppResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the App resource. + * + * @param properties Properties of the App resource. + * @return the next definition stage. + */ + Update withProperties(AppResourceProperties properties); + } + + /** The stage of the AppResource update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The Managed Identity type of the app resource. + * + * @param identity The Managed Identity type of the app resource. + * @return the next definition stage. + */ + Update withIdentity(ManagedIdentityProperties identity); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AppResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AppResource refresh(Context context); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive along with {@link Response}. + */ + Response getResourceUploadUrlWithResponse(Context context); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + ResourceUploadDefinition getResourceUploadUrl(); + + /** + * Set existing Deployment under the app as active. + * + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + AppResource setActiveDeployments(ActiveDeploymentCollection activeDeploymentCollection); + + /** + * Set existing Deployment under the app as active. + * + * @param activeDeploymentCollection A list of Deployment name to be active. + * @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 app resource payload. + */ + AppResource setActiveDeployments(ActiveDeploymentCollection activeDeploymentCollection, Context context); + + /** + * Check the resource name is valid as well as not in use. + * + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context); + + /** + * Check the resource name is valid as well as not in use. + * + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceCollection.java new file mode 100644 index 0000000000000..31706a723e562 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AppResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of App resources and a possible link for next set. */ +@Fluent +public final class AppResourceCollection { + /* + * Collection of App resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AppResourceCollection class. */ + public AppResourceCollection() { + } + + /** + * Get the value property: Collection of App resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of App resources. + * + * @param value the value value to set. + * @return the AppResourceCollection object itself. + */ + public AppResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AppResourceCollection object itself. + */ + public AppResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProperties.java new file mode 100644 index 0000000000000..1d396e1a6d8de --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProperties.java @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** App resource properties payload. */ +@Fluent +public final class AppResourceProperties { + /* + * Indicates whether the App exposes public endpoint + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /* + * URL of the App + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Collection of addons + */ + @JsonProperty(value = "addonConfigs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> addonConfigs; + + /* + * Provisioning state of the App + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private AppResourceProvisioningState provisioningState; + + /* + * Fully qualified dns Name. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Indicate if only https is allowed. + */ + @JsonProperty(value = "httpsOnly") + private Boolean httpsOnly; + + /* + * Temporary disk settings + */ + @JsonProperty(value = "temporaryDisk") + private TemporaryDisk temporaryDisk; + + /* + * Persistent disk settings + */ + @JsonProperty(value = "persistentDisk") + private PersistentDisk persistentDisk; + + /* + * List of custom persistent disks + */ + @JsonProperty(value = "customPersistentDisks") + private List customPersistentDisks; + + /* + * Indicate if end to end TLS is enabled. + */ + @JsonProperty(value = "enableEndToEndTLS") + private Boolean enableEndToEndTls; + + /* + * Collection of loaded certificates + */ + @JsonProperty(value = "loadedCertificates") + private List loadedCertificates; + + /* + * Additional App settings in vnet injection instance + */ + @JsonProperty(value = "vnetAddons") + private AppVNetAddons vnetAddons; + + /* + * App ingress settings payload. + */ + @JsonProperty(value = "ingressSettings") + private IngressSettings ingressSettings; + + /* + * Collection of auth secrets + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * The workload profile used for this app. Supported for Consumption + Dedicated plan. + */ + @JsonProperty(value = "workloadProfileName") + private String workloadProfileName; + + /** Creates an instance of AppResourceProperties class. */ + public AppResourceProperties() { + } + + /** + * Get the publicProperty property: Indicates whether the App exposes public endpoint. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: Indicates whether the App exposes public endpoint. + * + * @param publicProperty the publicProperty value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the url property: URL of the App. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the addonConfigs property: Collection of addons. + * + * @return the addonConfigs value. + */ + public Map> addonConfigs() { + return this.addonConfigs; + } + + /** + * Set the addonConfigs property: Collection of addons. + * + * @param addonConfigs the addonConfigs value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withAddonConfigs(Map> addonConfigs) { + this.addonConfigs = addonConfigs; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the App. + * + * @return the provisioningState value. + */ + public AppResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the fqdn property: Fully qualified dns Name. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the httpsOnly property: Indicate if only https is allowed. + * + * @return the httpsOnly value. + */ + public Boolean httpsOnly() { + return this.httpsOnly; + } + + /** + * Set the httpsOnly property: Indicate if only https is allowed. + * + * @param httpsOnly the httpsOnly value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withHttpsOnly(Boolean httpsOnly) { + this.httpsOnly = httpsOnly; + return this; + } + + /** + * Get the temporaryDisk property: Temporary disk settings. + * + * @return the temporaryDisk value. + */ + public TemporaryDisk temporaryDisk() { + return this.temporaryDisk; + } + + /** + * Set the temporaryDisk property: Temporary disk settings. + * + * @param temporaryDisk the temporaryDisk value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withTemporaryDisk(TemporaryDisk temporaryDisk) { + this.temporaryDisk = temporaryDisk; + return this; + } + + /** + * Get the persistentDisk property: Persistent disk settings. + * + * @return the persistentDisk value. + */ + public PersistentDisk persistentDisk() { + return this.persistentDisk; + } + + /** + * Set the persistentDisk property: Persistent disk settings. + * + * @param persistentDisk the persistentDisk value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withPersistentDisk(PersistentDisk persistentDisk) { + this.persistentDisk = persistentDisk; + return this; + } + + /** + * Get the customPersistentDisks property: List of custom persistent disks. + * + * @return the customPersistentDisks value. + */ + public List customPersistentDisks() { + return this.customPersistentDisks; + } + + /** + * Set the customPersistentDisks property: List of custom persistent disks. + * + * @param customPersistentDisks the customPersistentDisks value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withCustomPersistentDisks(List customPersistentDisks) { + this.customPersistentDisks = customPersistentDisks; + return this; + } + + /** + * Get the enableEndToEndTls property: Indicate if end to end TLS is enabled. + * + * @return the enableEndToEndTls value. + */ + public Boolean enableEndToEndTls() { + return this.enableEndToEndTls; + } + + /** + * Set the enableEndToEndTls property: Indicate if end to end TLS is enabled. + * + * @param enableEndToEndTls the enableEndToEndTls value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withEnableEndToEndTls(Boolean enableEndToEndTls) { + this.enableEndToEndTls = enableEndToEndTls; + return this; + } + + /** + * Get the loadedCertificates property: Collection of loaded certificates. + * + * @return the loadedCertificates value. + */ + public List loadedCertificates() { + return this.loadedCertificates; + } + + /** + * Set the loadedCertificates property: Collection of loaded certificates. + * + * @param loadedCertificates the loadedCertificates value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withLoadedCertificates(List loadedCertificates) { + this.loadedCertificates = loadedCertificates; + return this; + } + + /** + * Get the vnetAddons property: Additional App settings in vnet injection instance. + * + * @return the vnetAddons value. + */ + public AppVNetAddons vnetAddons() { + return this.vnetAddons; + } + + /** + * Set the vnetAddons property: Additional App settings in vnet injection instance. + * + * @param vnetAddons the vnetAddons value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withVnetAddons(AppVNetAddons vnetAddons) { + this.vnetAddons = vnetAddons; + return this; + } + + /** + * Get the ingressSettings property: App ingress settings payload. + * + * @return the ingressSettings value. + */ + public IngressSettings ingressSettings() { + return this.ingressSettings; + } + + /** + * Set the ingressSettings property: App ingress settings payload. + * + * @param ingressSettings the ingressSettings value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withIngressSettings(IngressSettings ingressSettings) { + this.ingressSettings = ingressSettings; + return this; + } + + /** + * Get the secrets property: Collection of auth secrets. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Collection of auth secrets. + * + * @param secrets the secrets value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the workloadProfileName property: The workload profile used for this app. Supported for Consumption + + * Dedicated plan. + * + * @return the workloadProfileName value. + */ + public String workloadProfileName() { + return this.workloadProfileName; + } + + /** + * Set the workloadProfileName property: The workload profile used for this app. Supported for Consumption + + * Dedicated plan. + * + * @param workloadProfileName the workloadProfileName value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withWorkloadProfileName(String workloadProfileName) { + this.workloadProfileName = workloadProfileName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (temporaryDisk() != null) { + temporaryDisk().validate(); + } + if (persistentDisk() != null) { + persistentDisk().validate(); + } + if (customPersistentDisks() != null) { + customPersistentDisks().forEach(e -> e.validate()); + } + if (loadedCertificates() != null) { + loadedCertificates().forEach(e -> e.validate()); + } + if (vnetAddons() != null) { + vnetAddons().validate(); + } + if (ingressSettings() != null) { + ingressSettings().validate(); + } + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProvisioningState.java new file mode 100644 index 0000000000000..f4a285cf2c85a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the App. */ +public final class AppResourceProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Creating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for AppResourceProvisioningState. */ + public static final AppResourceProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of AppResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AppResourceProvisioningState() { + } + + /** + * Creates or finds a AppResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppResourceProvisioningState. + */ + @JsonCreator + public static AppResourceProvisioningState fromString(String name) { + return fromString(name, AppResourceProvisioningState.class); + } + + /** + * Gets known AppResourceProvisioningState values. + * + * @return known AppResourceProvisioningState values. + */ + public static Collection values() { + return values(AppResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppVNetAddons.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppVNetAddons.java new file mode 100644 index 0000000000000..e92c0845ad68b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppVNetAddons.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Additional App settings in vnet injection instance. */ +@Fluent +public final class AppVNetAddons { + /* + * Indicates whether the App in vnet injection instance exposes endpoint which could be accessed from internet. + */ + @JsonProperty(value = "publicEndpoint") + private Boolean publicEndpoint; + + /* + * URL of the App in vnet injection instance which could be accessed from internet + */ + @JsonProperty(value = "publicEndpointUrl", access = JsonProperty.Access.WRITE_ONLY) + private String publicEndpointUrl; + + /** Creates an instance of AppVNetAddons class. */ + public AppVNetAddons() { + } + + /** + * Get the publicEndpoint property: Indicates whether the App in vnet injection instance exposes endpoint which + * could be accessed from internet. + * + * @return the publicEndpoint value. + */ + public Boolean publicEndpoint() { + return this.publicEndpoint; + } + + /** + * Set the publicEndpoint property: Indicates whether the App in vnet injection instance exposes endpoint which + * could be accessed from internet. + * + * @param publicEndpoint the publicEndpoint value to set. + * @return the AppVNetAddons object itself. + */ + public AppVNetAddons withPublicEndpoint(Boolean publicEndpoint) { + this.publicEndpoint = publicEndpoint; + return this; + } + + /** + * Get the publicEndpointUrl property: URL of the App in vnet injection instance which could be accessed from + * internet. + * + * @return the publicEndpointUrl value. + */ + public String publicEndpointUrl() { + return this.publicEndpointUrl; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorComponent.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorComponent.java new file mode 100644 index 0000000000000..eeef1d449b654 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorComponent.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The ApplicationAcceleratorComponent model. */ +@Fluent +public final class ApplicationAcceleratorComponent { + /* + * The name property. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The resourceRequests property. + */ + @JsonProperty(value = "resourceRequests") + private ApplicationAcceleratorResourceRequests resourceRequests; + + /* + * The instances property. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of ApplicationAcceleratorComponent class. */ + public ApplicationAcceleratorComponent() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the resourceRequests property: The resourceRequests property. + * + * @return the resourceRequests value. + */ + public ApplicationAcceleratorResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Set the resourceRequests property: The resourceRequests property. + * + * @param resourceRequests the resourceRequests value to set. + * @return the ApplicationAcceleratorComponent object itself. + */ + public ApplicationAcceleratorComponent withResourceRequests( + ApplicationAcceleratorResourceRequests resourceRequests) { + this.resourceRequests = resourceRequests; + return this; + } + + /** + * Get the instances property: The instances property. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorInstance.java new file mode 100644 index 0000000000000..1b5c92abcb3bf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationAcceleratorInstance model. */ +@Immutable +public final class ApplicationAcceleratorInstance { + /* + * Name of the Application Accelerator instance. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the Application Accelerator instance. It can be Pending, Running, Succeeded, Failed, Unknown. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ApplicationAcceleratorInstance class. */ + public ApplicationAcceleratorInstance() { + } + + /** + * Get the name property: Name of the Application Accelerator instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the Application Accelerator instance. It can be Pending, Running, Succeeded, + * Failed, Unknown. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorProperties.java new file mode 100644 index 0000000000000..4e503718a3904 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application accelerator properties payload. */ +@Immutable +public final class ApplicationAcceleratorProperties { + /* + * State of the application accelerator. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationAcceleratorProvisioningState provisioningState; + + /* + * Collection of components belong to application accelerator. + */ + @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) + private List components; + + /** Creates an instance of ApplicationAcceleratorProperties class. */ + public ApplicationAcceleratorProperties() { + } + + /** + * Get the provisioningState property: State of the application accelerator. + * + * @return the provisioningState value. + */ + public ApplicationAcceleratorProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the components property: Collection of components belong to application accelerator. + * + * @return the components value. + */ + public List components() { + return this.components; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (components() != null) { + components().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorProvisioningState.java new file mode 100644 index 0000000000000..aa378f07e27ae --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the application accelerator. */ +public final class ApplicationAcceleratorProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for ApplicationAcceleratorProvisioningState. */ + public static final ApplicationAcceleratorProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ApplicationAcceleratorProvisioningState. */ + public static final ApplicationAcceleratorProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ApplicationAcceleratorProvisioningState. */ + public static final ApplicationAcceleratorProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ApplicationAcceleratorProvisioningState. */ + public static final ApplicationAcceleratorProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ApplicationAcceleratorProvisioningState. */ + public static final ApplicationAcceleratorProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ApplicationAcceleratorProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationAcceleratorProvisioningState() { + } + + /** + * Creates or finds a ApplicationAcceleratorProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationAcceleratorProvisioningState. + */ + @JsonCreator + public static ApplicationAcceleratorProvisioningState fromString(String name) { + return fromString(name, ApplicationAcceleratorProvisioningState.class); + } + + /** + * Gets known ApplicationAcceleratorProvisioningState values. + * + * @return known ApplicationAcceleratorProvisioningState values. + */ + public static Collection values() { + return values(ApplicationAcceleratorProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResource.java new file mode 100644 index 0000000000000..6dfebf64e3a8d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResource.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner; + +/** An immutable client-side representation of ApplicationAcceleratorResource. */ +public interface ApplicationAcceleratorResource { + /** + * 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 properties property: Application accelerator properties payload. + * + * @return the properties value. + */ + ApplicationAcceleratorProperties properties(); + + /** + * Gets the sku property: Sku of the application accelerator 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner + * object. + * + * @return the inner object. + */ + ApplicationAcceleratorResourceInner innerModel(); + + /** The entirety of the ApplicationAcceleratorResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ApplicationAcceleratorResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationAcceleratorResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ApplicationAcceleratorResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the ApplicationAcceleratorResource 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.WithProperties, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationAcceleratorResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationAcceleratorResource create(Context context); + } + + /** The stage of the ApplicationAcceleratorResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Application accelerator properties payload. + * + * @param properties Application accelerator properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(ApplicationAcceleratorProperties properties); + } + + /** The stage of the ApplicationAcceleratorResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the application accelerator resource. + * + * @param sku Sku of the application accelerator resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the ApplicationAcceleratorResource resource. + * + * @return the stage of resource update. + */ + ApplicationAcceleratorResource.Update update(); + + /** The template for ApplicationAcceleratorResource update. */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationAcceleratorResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationAcceleratorResource apply(Context context); + } + + /** The ApplicationAcceleratorResource update stages. */ + interface UpdateStages { + /** The stage of the ApplicationAcceleratorResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Application accelerator properties payload. + * + * @param properties Application accelerator properties payload. + * @return the next definition stage. + */ + Update withProperties(ApplicationAcceleratorProperties properties); + } + + /** The stage of the ApplicationAcceleratorResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the application accelerator resource. + * + * @param sku Sku of the application accelerator resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationAcceleratorResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationAcceleratorResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResourceCollection.java new file mode 100644 index 0000000000000..b0974f96d7c00 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationAcceleratorResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of application accelerator resources and a possible link for next set. */ +@Fluent +public final class ApplicationAcceleratorResourceCollection { + /* + * Collection of application accelerator resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApplicationAcceleratorResourceCollection class. */ + public ApplicationAcceleratorResourceCollection() { + } + + /** + * Get the value property: Collection of application accelerator resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of application accelerator resources. + * + * @param value the value value to set. + * @return the ApplicationAcceleratorResourceCollection object itself. + */ + public ApplicationAcceleratorResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationAcceleratorResourceCollection object itself. + */ + public ApplicationAcceleratorResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResourceRequests.java new file mode 100644 index 0000000000000..1d4722a463ad2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAcceleratorResourceRequests.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ApplicationAcceleratorResourceRequests model. */ +@Immutable +public final class ApplicationAcceleratorResourceRequests { + /* + * Cpu allocated to each application accelerator component. 1 core can be represented by 1 or 1000m + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory allocated to each application accelerator component. 1 GB can be represented by 1Gi or 1024Mi. + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /* + * Instance count of the application accelerator component. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** Creates an instance of ApplicationAcceleratorResourceRequests class. */ + public ApplicationAcceleratorResourceRequests() { + } + + /** + * Get the cpu property: Cpu allocated to each application accelerator component. 1 core can be represented by 1 or + * 1000m. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory allocated to each application accelerator component. 1 GB can be represented by + * 1Gi or 1024Mi. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Get the instanceCount property: Instance count of the application accelerator component. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAccelerators.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAccelerators.java new file mode 100644 index 0000000000000..dc3b13052b9c2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationAccelerators.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationAccelerators. */ +public interface ApplicationAccelerators { + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handle requests to list all application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of application accelerator resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 application accelerator along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the application accelerator. + */ + ApplicationAcceleratorResource get(String resourceGroupName, String serviceName, String applicationAcceleratorName); + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String applicationAcceleratorName); + + /** + * Delete the application accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the application accelerator. + * + * @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 application accelerator along with {@link Response}. + */ + ApplicationAcceleratorResource getById(String id); + + /** + * Get the application accelerator. + * + * @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 application accelerator along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the application accelerator. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the application accelerator. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApplicationAcceleratorResource resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationAcceleratorResource definition. + */ + ApplicationAcceleratorResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationInsightsAgentVersions.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationInsightsAgentVersions.java new file mode 100644 index 0000000000000..9c186cc489991 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationInsightsAgentVersions.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Insights agent versions properties payload. */ +@Immutable +public final class ApplicationInsightsAgentVersions { + /* + * Indicates the version of application insight java agent + */ + @JsonProperty(value = "java", access = JsonProperty.Access.WRITE_ONLY) + private String java; + + /** Creates an instance of ApplicationInsightsAgentVersions class. */ + public ApplicationInsightsAgentVersions() { + } + + /** + * Get the java property: Indicates the version of application insight java agent. + * + * @return the java value. + */ + public String java() { + return this.java; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewComponent.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewComponent.java new file mode 100644 index 0000000000000..16fc0943e463a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewComponent.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application Live View properties payload. */ +@Immutable +public final class ApplicationLiveViewComponent { + /* + * Name of the component. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private Object name; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationLiveViewResourceRequests resourceRequests; + + /* + * Collection of instances belong to Application Live View. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of ApplicationLiveViewComponent class. */ + public ApplicationLiveViewComponent() { + } + + /** + * Get the name property: Name of the component. + * + * @return the name value. + */ + public Object name() { + return this.name; + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public ApplicationLiveViewResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Get the instances property: Collection of instances belong to Application Live View. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewInstance.java new file mode 100644 index 0000000000000..b4a8f70efe11b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Application Live View. */ +@Immutable +public final class ApplicationLiveViewInstance { + /* + * Name of the Application Live View instance. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the Application Live View instance. It can be Pending, Running, Succeeded, Failed, Unknown. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ApplicationLiveViewInstance class. */ + public ApplicationLiveViewInstance() { + } + + /** + * Get the name property: Name of the Application Live View instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the Application Live View instance. It can be Pending, Running, Succeeded, + * Failed, Unknown. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewProperties.java new file mode 100644 index 0000000000000..0b789f5457d99 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewProperties.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application Live View properties payload. */ +@Immutable +public final class ApplicationLiveViewProperties { + /* + * State of the Application Live View. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationLiveViewProvisioningState provisioningState; + + /* + * Component details of Application Live View + */ + @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) + private List components; + + /** Creates an instance of ApplicationLiveViewProperties class. */ + public ApplicationLiveViewProperties() { + } + + /** + * Get the provisioningState property: State of the Application Live View. + * + * @return the provisioningState value. + */ + public ApplicationLiveViewProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the components property: Component details of Application Live View. + * + * @return the components value. + */ + public List components() { + return this.components; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (components() != null) { + components().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewProvisioningState.java new file mode 100644 index 0000000000000..2bed9d88fc80c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewProvisioningState.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Application Live View. */ +public final class ApplicationLiveViewProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for ApplicationLiveViewProvisioningState. */ + public static final ApplicationLiveViewProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ApplicationLiveViewProvisioningState. */ + public static final ApplicationLiveViewProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ApplicationLiveViewProvisioningState. */ + public static final ApplicationLiveViewProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ApplicationLiveViewProvisioningState. */ + public static final ApplicationLiveViewProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ApplicationLiveViewProvisioningState. */ + public static final ApplicationLiveViewProvisioningState DELETING = fromString("Deleting"); + + /** Static value Canceled for ApplicationLiveViewProvisioningState. */ + public static final ApplicationLiveViewProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ApplicationLiveViewProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationLiveViewProvisioningState() { + } + + /** + * Creates or finds a ApplicationLiveViewProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationLiveViewProvisioningState. + */ + @JsonCreator + public static ApplicationLiveViewProvisioningState fromString(String name) { + return fromString(name, ApplicationLiveViewProvisioningState.class); + } + + /** + * Gets known ApplicationLiveViewProvisioningState values. + * + * @return known ApplicationLiveViewProvisioningState values. + */ + public static Collection values() { + return values(ApplicationLiveViewProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResource.java new file mode 100644 index 0000000000000..283e88b0dca2f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner; + +/** An immutable client-side representation of ApplicationLiveViewResource. */ +public interface ApplicationLiveViewResource { + /** + * 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 properties property: Application Live View properties payload. + * + * @return the properties value. + */ + ApplicationLiveViewProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner + * object. + * + * @return the inner object. + */ + ApplicationLiveViewResourceInner innerModel(); + + /** The entirety of the ApplicationLiveViewResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ApplicationLiveViewResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ApplicationLiveViewResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ApplicationLiveViewResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the ApplicationLiveViewResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ApplicationLiveViewResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ApplicationLiveViewResource create(Context context); + } + + /** The stage of the ApplicationLiveViewResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Application Live View properties payload. + * + * @param properties Application Live View properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(ApplicationLiveViewProperties properties); + } + } + + /** + * Begins update for the ApplicationLiveViewResource resource. + * + * @return the stage of resource update. + */ + ApplicationLiveViewResource.Update update(); + + /** The template for ApplicationLiveViewResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ApplicationLiveViewResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ApplicationLiveViewResource apply(Context context); + } + + /** The ApplicationLiveViewResource update stages. */ + interface UpdateStages { + /** The stage of the ApplicationLiveViewResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Application Live View properties payload. + * + * @param properties Application Live View properties payload. + * @return the next definition stage. + */ + Update withProperties(ApplicationLiveViewProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ApplicationLiveViewResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ApplicationLiveViewResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResourceCollection.java new file mode 100644 index 0000000000000..fd014ac5d1f52 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApplicationLiveViewResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Application Live View resources and a possible link for next set. */ +@Fluent +public final class ApplicationLiveViewResourceCollection { + /* + * Collection of Application Live View resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ApplicationLiveViewResourceCollection class. */ + public ApplicationLiveViewResourceCollection() { + } + + /** + * Get the value property: Collection of Application Live View resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Application Live View resources. + * + * @param value the value value to set. + * @return the ApplicationLiveViewResourceCollection object itself. + */ + public ApplicationLiveViewResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ApplicationLiveViewResourceCollection object itself. + */ + public ApplicationLiveViewResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResourceRequests.java new file mode 100644 index 0000000000000..6551a4d83b44d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViewResourceRequests.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource quantity for required CPU and Memory of Application Live View component. */ +@Immutable +public final class ApplicationLiveViewResourceRequests { + /* + * Cpu quantity allocated to each Application Live View component instance. 1 core can be represented by 1 or + * 1000m. + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory quantity allocated to each Application Live View component instance. 1 GB can be represented by 1Gi or + * 1024Mi. + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /* + * Desired instance count of Application Live View component instance. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** Creates an instance of ApplicationLiveViewResourceRequests class. */ + public ApplicationLiveViewResourceRequests() { + } + + /** + * Get the cpu property: Cpu quantity allocated to each Application Live View component instance. 1 core can be + * represented by 1 or 1000m. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory quantity allocated to each Application Live View component instance. 1 GB can be + * represented by 1Gi or 1024Mi. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Get the instanceCount property: Desired instance count of Application Live View component instance. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViews.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViews.java new file mode 100644 index 0000000000000..4ce77015d3ce7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApplicationLiveViews.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ApplicationLiveViews. */ +public interface ApplicationLiveViews { + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Application Live View resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @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 Application Live and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String applicationLiveViewName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties. + */ + ApplicationLiveViewResource get(String resourceGroupName, String serviceName, String applicationLiveViewName); + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String applicationLiveViewName); + + /** + * Disable the default Application Live View. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationLiveViewName The name of Application Live View. + * @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 serviceName, String applicationLiveViewName, Context context); + + /** + * Get the Application Live and its properties. + * + * @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 Application Live and its properties along with {@link Response}. + */ + ApplicationLiveViewResource getById(String id); + + /** + * Get the Application Live and its properties. + * + * @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 Application Live and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Disable the default Application Live View. + * + * @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); + + /** + * Disable the default Application Live View. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ApplicationLiveViewResource resource. + * + * @param name resource name. + * @return the first stage of the new ApplicationLiveViewResource definition. + */ + ApplicationLiveViewResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apps.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apps.java new file mode 100644 index 0000000000000..796f7a7381b1f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apps.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Apps. */ +public interface Apps { + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String syncStatus, Context context); + + /** + * Get an App and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties. + */ + AppResource get(String resourceGroupName, String serviceName, String appName); + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName); + + /** + * Operation to delete an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive along with {@link Response}. + */ + Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Get an resource upload URL for an App, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for an App, which may be artifacts or source archive. + */ + ResourceUploadDefinition getResourceUploadUrl(String resourceGroupName, String serviceName, String appName); + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app resource payload. + */ + AppResource setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection); + + /** + * Set existing Deployment under the app as active. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param activeDeploymentCollection A list of Deployment name to be active. + * @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 app resource payload. + */ + AppResource setActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context); + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String appName, + CustomDomainValidatePayload validatePayload, + Context context); + + /** + * Check the resource name is valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + CustomDomainValidateResult validateDomain( + String resourceGroupName, String serviceName, String appName, CustomDomainValidatePayload validatePayload); + + /** + * Get an App and its properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response}. + */ + AppResource getById(String id); + + /** + * Get an App and its properties. + * + * @param id the resource ID. + * @param syncStatus Indicates whether sync status. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an App and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, String syncStatus, Context context); + + /** + * Operation to delete an App. + * + * @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); + + /** + * Operation to delete an App. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AppResource resource. + * + * @param name resource name. + * @return the first stage of the new AppResource definition. + */ + AppResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AvailableOperations.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AvailableOperations.java new file mode 100644 index 0000000000000..d78da3b58f669 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AvailableOperations.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Available operations of the service. */ +@Fluent +public final class AvailableOperations { + /* + * Collection of available operation details + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AvailableOperations class. */ + public AvailableOperations() { + } + + /** + * Get the value property: Collection of available operation details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of available operation details. + * + * @param value the value value to set. + * @return the AvailableOperations object itself. + */ + public AvailableOperations withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AvailableOperations object itself. + */ + public AvailableOperations 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AvailableRuntimeVersions.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AvailableRuntimeVersions.java new file mode 100644 index 0000000000000..21495e5a9077f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AvailableRuntimeVersions.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.AvailableRuntimeVersionsInner; +import java.util.List; + +/** An immutable client-side representation of AvailableRuntimeVersions. */ +public interface AvailableRuntimeVersions { + /** + * Gets the value property: A list of all supported runtime versions. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.AvailableRuntimeVersionsInner + * object. + * + * @return the inner object. + */ + AvailableRuntimeVersionsInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AzureFileVolume.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AzureFileVolume.java new file mode 100644 index 0000000000000..dbe76d710368c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AzureFileVolume.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** The properties of the Azure File volume. Azure File shares are mounted as volumes. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("AzureFileVolume") +@Fluent +public final class AzureFileVolume extends CustomPersistentDiskProperties { + /* + * The share name of the Azure File share. + */ + @JsonProperty(value = "shareName") + private String shareName; + + /** Creates an instance of AzureFileVolume class. */ + public AzureFileVolume() { + } + + /** + * Get the shareName property: The share name of the Azure File share. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: The share name of the Azure File share. + * + * @param shareName the shareName value to set. + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileVolume withMountPath(String mountPath) { + super.withMountPath(mountPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileVolume withReadOnly(Boolean readOnly) { + super.withReadOnly(readOnly); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileVolume withEnableSubPath(Boolean enableSubPath) { + super.withEnableSubPath(enableSubPath); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureFileVolume withMountOptions(List mountOptions) { + super.withMountOptions(mountOptions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BackendProtocol.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BackendProtocol.java new file mode 100644 index 0000000000000..4bf3770479497 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BackendProtocol.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** How ingress should communicate with this app backend service. */ +public final class BackendProtocol extends ExpandableStringEnum { + /** Static value GRPC for BackendProtocol. */ + public static final BackendProtocol GRPC = fromString("GRPC"); + + /** Static value Default for BackendProtocol. */ + public static final BackendProtocol DEFAULT = fromString("Default"); + + /** + * Creates a new instance of BackendProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackendProtocol() { + } + + /** + * Creates or finds a BackendProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackendProtocol. + */ + @JsonCreator + public static BackendProtocol fromString(String name) { + return fromString(name, BackendProtocol.class); + } + + /** + * Gets known BackendProtocol values. + * + * @return known BackendProtocol values. + */ + public static Collection values() { + return values(BackendProtocol.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResource.java new file mode 100644 index 0000000000000..74b238696e807 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner; + +/** An immutable client-side representation of BindingResource. */ +public interface BindingResource { + /** + * 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 properties property: Properties of the Binding resource. + * + * @return the properties value. + */ + BindingResourceProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner object. + * + * @return the inner object. + */ + BindingResourceInner innerModel(); + + /** The entirety of the BindingResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The BindingResource definition stages. */ + interface DefinitionStages { + /** The first stage of the BindingResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the BindingResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, appName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @return the next definition stage. + */ + WithCreate withExistingApp(String resourceGroupName, String serviceName, String appName); + } + + /** + * The stage of the BindingResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + BindingResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BindingResource create(Context context); + } + + /** The stage of the BindingResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the Binding resource. + * + * @param properties Properties of the Binding resource. + * @return the next definition stage. + */ + WithCreate withProperties(BindingResourceProperties properties); + } + } + + /** + * Begins update for the BindingResource resource. + * + * @return the stage of resource update. + */ + BindingResource.Update update(); + + /** The template for BindingResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BindingResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BindingResource apply(Context context); + } + + /** The BindingResource update stages. */ + interface UpdateStages { + /** The stage of the BindingResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the Binding resource. + * + * @param properties Properties of the Binding resource. + * @return the next definition stage. + */ + Update withProperties(BindingResourceProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BindingResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BindingResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceCollection.java new file mode 100644 index 0000000000000..f31199e3c0e29 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Binding resources and a possible link for next set. */ +@Fluent +public final class BindingResourceCollection { + /* + * Collection of Binding resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BindingResourceCollection class. */ + public BindingResourceCollection() { + } + + /** + * Get the value property: Collection of Binding resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Binding resources. + * + * @param value the value value to set. + * @return the BindingResourceCollection object itself. + */ + public BindingResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BindingResourceCollection object itself. + */ + public BindingResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceProperties.java new file mode 100644 index 0000000000000..a5fb4180d9f3c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceProperties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Binding resource properties payload. */ +@Fluent +public final class BindingResourceProperties { + /* + * The name of the bound resource + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /* + * The standard Azure resource type of the bound resource + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * The Azure resource id of the bound resource + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /* + * The key of the bound resource + */ + @JsonProperty(value = "key") + private String key; + + /* + * Binding parameters of the Binding resource + */ + @JsonProperty(value = "bindingParameters") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map bindingParameters; + + /* + * The generated Spring Boot property file for this binding. The secret will be deducted. + */ + @JsonProperty(value = "generatedProperties", access = JsonProperty.Access.WRITE_ONLY) + private String generatedProperties; + + /* + * Creation time of the Binding resource + */ + @JsonProperty(value = "createdAt", access = JsonProperty.Access.WRITE_ONLY) + private String createdAt; + + /* + * Update time of the Binding resource + */ + @JsonProperty(value = "updatedAt", access = JsonProperty.Access.WRITE_ONLY) + private String updatedAt; + + /** Creates an instance of BindingResourceProperties class. */ + public BindingResourceProperties() { + } + + /** + * Get the resourceName property: The name of the bound resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the resourceType property: The standard Azure resource type of the bound resource. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the resourceId property: The Azure resource id of the bound resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The Azure resource id of the bound resource. + * + * @param resourceId the resourceId value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the key property: The key of the bound resource. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Set the key property: The key of the bound resource. + * + * @param key the key value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withKey(String key) { + this.key = key; + return this; + } + + /** + * Get the bindingParameters property: Binding parameters of the Binding resource. + * + * @return the bindingParameters value. + */ + public Map bindingParameters() { + return this.bindingParameters; + } + + /** + * Set the bindingParameters property: Binding parameters of the Binding resource. + * + * @param bindingParameters the bindingParameters value to set. + * @return the BindingResourceProperties object itself. + */ + public BindingResourceProperties withBindingParameters(Map bindingParameters) { + this.bindingParameters = bindingParameters; + return this; + } + + /** + * Get the generatedProperties property: The generated Spring Boot property file for this binding. The secret will + * be deducted. + * + * @return the generatedProperties value. + */ + public String generatedProperties() { + return this.generatedProperties; + } + + /** + * Get the createdAt property: Creation time of the Binding resource. + * + * @return the createdAt value. + */ + public String createdAt() { + return this.createdAt; + } + + /** + * Get the updatedAt property: Update time of the Binding resource. + * + * @return the updatedAt value. + */ + public String updatedAt() { + return this.updatedAt; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingType.java new file mode 100644 index 0000000000000..1bdd570786f8e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Buildpack Binding Type. */ +public final class BindingType extends ExpandableStringEnum { + /** Static value ApplicationInsights for BindingType. */ + public static final BindingType APPLICATION_INSIGHTS = fromString("ApplicationInsights"); + + /** Static value ApacheSkyWalking for BindingType. */ + public static final BindingType APACHE_SKY_WALKING = fromString("ApacheSkyWalking"); + + /** Static value AppDynamics for BindingType. */ + public static final BindingType APP_DYNAMICS = fromString("AppDynamics"); + + /** Static value Dynatrace for BindingType. */ + public static final BindingType DYNATRACE = fromString("Dynatrace"); + + /** Static value NewRelic for BindingType. */ + public static final BindingType NEW_RELIC = fromString("NewRelic"); + + /** Static value ElasticAPM for BindingType. */ + public static final BindingType ELASTIC_APM = fromString("ElasticAPM"); + + /** Static value CACertificates for BindingType. */ + public static final BindingType CACERTIFICATES = fromString("CACertificates"); + + /** + * Creates a new instance of BindingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BindingType() { + } + + /** + * Creates or finds a BindingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding BindingType. + */ + @JsonCreator + public static BindingType fromString(String name) { + return fromString(name, BindingType.class); + } + + /** + * Gets known BindingType values. + * + * @return known BindingType values. + */ + public static Collection values() { + return values(BindingType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Bindings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Bindings.java new file mode 100644 index 0000000000000..afe1861d07631 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Bindings.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Bindings. */ +public interface Bindings { + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context); + + /** + * Get a Binding and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties. + */ + BindingResource get(String resourceGroupName, String serviceName, String appName, String bindingName); + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, String bindingName); + + /** + * Operation to delete a Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param bindingName The name of the Binding resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, String bindingName, Context context); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String appName); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Binding resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Get a Binding and its properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response}. + */ + BindingResource getById(String id); + + /** + * Get a Binding and its properties. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Binding and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete a Binding. + * + * @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); + + /** + * Operation to delete a Binding. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BindingResource resource. + * + * @param name resource name. + * @return the first stage of the new BindingResource definition. + */ + BindingResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Build.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Build.java new file mode 100644 index 0000000000000..ae5bac025ce38 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Build.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner; + +/** An immutable client-side representation of Build. */ +public interface Build { + /** + * 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 properties property: Properties of the build resource. + * + * @return the properties value. + */ + BuildProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner object. + * + * @return the inner object. + */ + BuildInner innerModel(); + + /** The entirety of the Build definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The Build definition stages. */ + interface DefinitionStages { + /** The first stage of the Build definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the Build definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, buildServiceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @return the next definition stage. + */ + WithCreate withExistingBuildService(String resourceGroupName, String serviceName, String buildServiceName); + } + + /** + * The stage of the Build 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Build create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Build create(Context context); + } + + /** The stage of the Build definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the build resource. + * + * @param properties Properties of the build resource. + * @return the next definition stage. + */ + WithCreate withProperties(BuildProperties properties); + } + } + + /** + * Begins update for the Build resource. + * + * @return the stage of resource update. + */ + Build.Update update(); + + /** The template for Build update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Build apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Build apply(Context context); + } + + /** The Build update stages. */ + interface UpdateStages { + /** The stage of the Build update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the build resource. + * + * @param properties Properties of the build resource. + * @return the next definition stage. + */ + Update withProperties(BuildProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Build refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Build refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildCollection.java new file mode 100644 index 0000000000000..8672ef8582ec5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Build resources and a possible link for next set. */ +@Fluent +public final class BuildCollection { + /* + * Collection of Build resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BuildCollection class. */ + public BuildCollection() { + } + + /** + * Get the value property: Collection of Build resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Build resources. + * + * @param value the value value to set. + * @return the BuildCollection object itself. + */ + public BuildCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BuildCollection object itself. + */ + public BuildCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProperties.java new file mode 100644 index 0000000000000..2503d76b2e6d8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProperties.java @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Build resource properties payload. */ +@Fluent +public final class BuildProperties { + /* + * The relative path of source code + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * The resource id of builder to build the source code + */ + @JsonProperty(value = "builder") + private String builder; + + /* + * The resource id of agent pool + */ + @JsonProperty(value = "agentPool") + private String agentPool; + + /* + * Provisioning state of the KPack build result + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BuildProvisioningState provisioningState; + + /* + * The environment variables for this build + */ + @JsonProperty(value = "env") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map env; + + /* + * The APMs for this build + */ + @JsonProperty(value = "apms") + private List apms; + + /* + * The CA Certificates for this build + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * The build result triggered by this build + */ + @JsonProperty(value = "triggeredBuildResult", access = JsonProperty.Access.WRITE_ONLY) + private TriggeredBuildResult triggeredBuildResult; + + /* + * The customized build resource for this build + */ + @JsonProperty(value = "resourceRequests") + private BuildResourceRequests resourceRequests; + + /** Creates an instance of BuildProperties class. */ + public BuildProperties() { + } + + /** + * Get the relativePath property: The relative path of source code. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: The relative path of source code. + * + * @param relativePath the relativePath value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** + * Get the builder property: The resource id of builder to build the source code. + * + * @return the builder value. + */ + public String builder() { + return this.builder; + } + + /** + * Set the builder property: The resource id of builder to build the source code. + * + * @param builder the builder value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withBuilder(String builder) { + this.builder = builder; + return this; + } + + /** + * Get the agentPool property: The resource id of agent pool. + * + * @return the agentPool value. + */ + public String agentPool() { + return this.agentPool; + } + + /** + * Set the agentPool property: The resource id of agent pool. + * + * @param agentPool the agentPool value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withAgentPool(String agentPool) { + this.agentPool = agentPool; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the KPack build result. + * + * @return the provisioningState value. + */ + public BuildProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the env property: The environment variables for this build. + * + * @return the env value. + */ + public Map env() { + return this.env; + } + + /** + * Set the env property: The environment variables for this build. + * + * @param env the env value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withEnv(Map env) { + this.env = env; + return this; + } + + /** + * Get the apms property: The APMs for this build. + * + * @return the apms value. + */ + public List apms() { + return this.apms; + } + + /** + * Set the apms property: The APMs for this build. + * + * @param apms the apms value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withApms(List apms) { + this.apms = apms; + return this; + } + + /** + * Get the certificates property: The CA Certificates for this build. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: The CA Certificates for this build. + * + * @param certificates the certificates value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the triggeredBuildResult property: The build result triggered by this build. + * + * @return the triggeredBuildResult value. + */ + public TriggeredBuildResult triggeredBuildResult() { + return this.triggeredBuildResult; + } + + /** + * Get the resourceRequests property: The customized build resource for this build. + * + * @return the resourceRequests value. + */ + public BuildResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Set the resourceRequests property: The customized build resource for this build. + * + * @param resourceRequests the resourceRequests value to set. + * @return the BuildProperties object itself. + */ + public BuildProperties withResourceRequests(BuildResourceRequests resourceRequests) { + this.resourceRequests = resourceRequests; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (apms() != null) { + apms().forEach(e -> e.validate()); + } + if (certificates() != null) { + certificates().forEach(e -> e.validate()); + } + if (triggeredBuildResult() != null) { + triggeredBuildResult().validate(); + } + if (resourceRequests() != null) { + resourceRequests().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProvisioningState.java new file mode 100644 index 0000000000000..f39a7be8c6752 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the KPack build result. */ +public final class BuildProvisioningState extends ExpandableStringEnum { + /** Static value Creating for BuildProvisioningState. */ + public static final BuildProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for BuildProvisioningState. */ + public static final BuildProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for BuildProvisioningState. */ + public static final BuildProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BuildProvisioningState. */ + public static final BuildProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for BuildProvisioningState. */ + public static final BuildProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuildProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuildProvisioningState() { + } + + /** + * Creates or finds a BuildProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuildProvisioningState. + */ + @JsonCreator + public static BuildProvisioningState fromString(String name) { + return fromString(name, BuildProvisioningState.class); + } + + /** + * Gets known BuildProvisioningState values. + * + * @return known BuildProvisioningState values. + */ + public static Collection values() { + return values(BuildProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResourceRequests.java new file mode 100644 index 0000000000000..ce186c7c0112a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResourceRequests.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Build Resource. */ +@Fluent +public final class BuildResourceRequests { + /* + * Optional Cpu allocated to the build resource. 1 core can be represented by 1 or 1000m. + * The default value is 1, this should not exceed build service agent pool cpu size. + */ + @JsonProperty(value = "cpu") + private String cpu; + + /* + * Optional Memory allocated to the build resource. 1 GB can be represented by 1Gi or 1024Mi. + * The default value is 2Gi, this should not exceed build service agent pool memory size. + */ + @JsonProperty(value = "memory") + private String memory; + + /** Creates an instance of BuildResourceRequests class. */ + public BuildResourceRequests() { + } + + /** + * Get the cpu property: Optional Cpu allocated to the build resource. 1 core can be represented by 1 or 1000m. The + * default value is 1, this should not exceed build service agent pool cpu size. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Optional Cpu allocated to the build resource. 1 core can be represented by 1 or 1000m. The + * default value is 1, this should not exceed build service agent pool cpu size. + * + * @param cpu the cpu value to set. + * @return the BuildResourceRequests object itself. + */ + public BuildResourceRequests withCpu(String cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Optional Memory allocated to the build resource. 1 GB can be represented by 1Gi or + * 1024Mi. The default value is 2Gi, this should not exceed build service agent pool memory size. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Optional Memory allocated to the build resource. 1 GB can be represented by 1Gi or + * 1024Mi. The default value is 2Gi, this should not exceed build service agent pool memory size. + * + * @param memory the memory value to set. + * @return the BuildResourceRequests object itself. + */ + public BuildResourceRequests withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResult.java new file mode 100644 index 0000000000000..7a7ee93b76a9a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResult.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; + +/** An immutable client-side representation of BuildResult. */ +public interface BuildResult { + /** + * 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 properties property: Properties of the build result resource. + * + * @return the properties value. + */ + BuildResultProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner object. + * + * @return the inner object. + */ + BuildResultInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultCollection.java new file mode 100644 index 0000000000000..95e35b8bc39b1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Build result resources and a possible link for next set. */ +@Fluent +public final class BuildResultCollection { + /* + * Collection of Build result resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BuildResultCollection class. */ + public BuildResultCollection() { + } + + /** + * Get the value property: Collection of Build result resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Build result resources. + * + * @param value the value value to set. + * @return the BuildResultCollection object itself. + */ + public BuildResultCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BuildResultCollection object itself. + */ + public BuildResultCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultLog.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultLog.java new file mode 100644 index 0000000000000..d8df61614ac59 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultLog.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultLogInner; + +/** An immutable client-side representation of BuildResultLog. */ +public interface BuildResultLog { + /** + * Gets the blobUrl property: The public download URL of this build result log. + * + * @return the blobUrl value. + */ + String blobUrl(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultLogInner object. + * + * @return the inner object. + */ + BuildResultLogInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProperties.java new file mode 100644 index 0000000000000..5837586a2ac4f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Build result resource properties payload. */ +@Fluent +public final class BuildResultProperties { + /* + * The name of this build result + */ + @JsonProperty(value = "name") + private String name; + + /* + * Provisioning state of the KPack build result + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BuildResultProvisioningState provisioningState; + + /* + * Error when build is failed. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * The build pod name which can be used to get the build log streaming. + */ + @JsonProperty(value = "buildPodName") + private String buildPodName; + + /* + * All of the build stage (init-container and container) resources in build pod. + */ + @JsonProperty(value = "buildStages", access = JsonProperty.Access.WRITE_ONLY) + private List buildStages; + + /* + * The container registry image of this build result. + */ + @JsonProperty(value = "image", access = JsonProperty.Access.WRITE_ONLY) + private String image; + + /** Creates an instance of BuildResultProperties class. */ + public BuildResultProperties() { + } + + /** + * Get the name property: The name of this build result. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of this build result. + * + * @param name the name value to set. + * @return the BuildResultProperties object itself. + */ + public BuildResultProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the KPack build result. + * + * @return the provisioningState value. + */ + public BuildResultProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the error property: Error when build is failed. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when build is failed. + * + * @param error the error value to set. + * @return the BuildResultProperties object itself. + */ + public BuildResultProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the buildPodName property: The build pod name which can be used to get the build log streaming. + * + * @return the buildPodName value. + */ + public String buildPodName() { + return this.buildPodName; + } + + /** + * Set the buildPodName property: The build pod name which can be used to get the build log streaming. + * + * @param buildPodName the buildPodName value to set. + * @return the BuildResultProperties object itself. + */ + public BuildResultProperties withBuildPodName(String buildPodName) { + this.buildPodName = buildPodName; + return this; + } + + /** + * Get the buildStages property: All of the build stage (init-container and container) resources in build pod. + * + * @return the buildStages value. + */ + public List buildStages() { + return this.buildStages; + } + + /** + * Get the image property: The container registry image of this build result. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (buildStages() != null) { + buildStages().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProvisioningState.java new file mode 100644 index 0000000000000..4c2803b50d419 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the KPack build result. */ +public final class BuildResultProvisioningState extends ExpandableStringEnum { + /** Static value Queuing for BuildResultProvisioningState. */ + public static final BuildResultProvisioningState QUEUING = fromString("Queuing"); + + /** Static value Building for BuildResultProvisioningState. */ + public static final BuildResultProvisioningState BUILDING = fromString("Building"); + + /** Static value Succeeded for BuildResultProvisioningState. */ + public static final BuildResultProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BuildResultProvisioningState. */ + public static final BuildResultProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for BuildResultProvisioningState. */ + public static final BuildResultProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuildResultProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuildResultProvisioningState() { + } + + /** + * Creates or finds a BuildResultProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuildResultProvisioningState. + */ + @JsonCreator + public static BuildResultProvisioningState fromString(String name) { + return fromString(name, BuildResultProvisioningState.class); + } + + /** + * Gets known BuildResultProvisioningState values. + * + * @return known BuildResultProvisioningState values. + */ + public static Collection values() { + return values(BuildResultProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultUserSourceInfo.java new file mode 100644 index 0000000000000..cf07eed91282a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultUserSourceInfo.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Reference to a build result. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("BuildResult") +@Fluent +public final class BuildResultUserSourceInfo extends UserSourceInfo { + /* + * Resource id of an existing succeeded build result under the same Spring instance. + */ + @JsonProperty(value = "buildResultId") + private String buildResultId; + + /** Creates an instance of BuildResultUserSourceInfo class. */ + public BuildResultUserSourceInfo() { + } + + /** + * Get the buildResultId property: Resource id of an existing succeeded build result under the same Spring instance. + * + * @return the buildResultId value. + */ + public String buildResultId() { + return this.buildResultId; + } + + /** + * Set the buildResultId property: Resource id of an existing succeeded build result under the same Spring instance. + * + * @param buildResultId the buildResultId value to set. + * @return the BuildResultUserSourceInfo object itself. + */ + public BuildResultUserSourceInfo withBuildResultId(String buildResultId) { + this.buildResultId = buildResultId; + return this; + } + + /** {@inheritDoc} */ + @Override + public BuildResultUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildService.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildService.java new file mode 100644 index 0000000000000..5eb026359a210 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildService.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; + +/** An immutable client-side representation of BuildService. */ +public interface BuildService { + /** + * 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 properties property: Properties of the build resource. + * + * @return the properties value. + */ + BuildServiceProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner object. + * + * @return the inner object. + */ + BuildServiceInner innerModel(); + + /** The entirety of the BuildService definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The BuildService definition stages. */ + interface DefinitionStages { + /** The first stage of the BuildService definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the BuildService definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the BuildService 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + BuildService create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BuildService create(Context context); + } + + /** The stage of the BuildService definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the build resource. + * + * @param properties Properties of the build resource. + * @return the next definition stage. + */ + WithCreate withProperties(BuildServiceProperties properties); + } + } + + /** + * Begins update for the BuildService resource. + * + * @return the stage of resource update. + */ + BuildService.Update update(); + + /** The template for BuildService update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BuildService apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BuildService apply(Context context); + } + + /** The BuildService update stages. */ + interface UpdateStages { + /** The stage of the BuildService update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the build resource. + * + * @param properties Properties of the build resource. + * @return the next definition stage. + */ + Update withProperties(BuildServiceProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BuildService refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BuildService refresh(Context context); + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive along with {@link + * Response}. + */ + Response getResourceUploadUrlWithResponse(Context context); + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive. + */ + ResourceUploadDefinition getResourceUploadUrl(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolProperties.java new file mode 100644 index 0000000000000..f39c9070d62b1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service agent pool properties. */ +@Fluent +public final class BuildServiceAgentPoolProperties { + /* + * Provisioning state of the build service agent pool + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * build service agent pool size properties + */ + @JsonProperty(value = "poolSize") + private BuildServiceAgentPoolSizeProperties poolSize; + + /** Creates an instance of BuildServiceAgentPoolProperties class. */ + public BuildServiceAgentPoolProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the build service agent pool. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the poolSize property: build service agent pool size properties. + * + * @return the poolSize value. + */ + public BuildServiceAgentPoolSizeProperties poolSize() { + return this.poolSize; + } + + /** + * Set the poolSize property: build service agent pool size properties. + * + * @param poolSize the poolSize value to set. + * @return the BuildServiceAgentPoolProperties object itself. + */ + public BuildServiceAgentPoolProperties withPoolSize(BuildServiceAgentPoolSizeProperties poolSize) { + this.poolSize = poolSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (poolSize() != null) { + poolSize().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolResource.java new file mode 100644 index 0000000000000..cc8e75fb89e3e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; + +/** An immutable client-side representation of BuildServiceAgentPoolResource. */ +public interface BuildServiceAgentPoolResource { + /** + * 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 properties property: build service agent pool properties. + * + * @return the properties value. + */ + BuildServiceAgentPoolProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner + * object. + * + * @return the inner object. + */ + BuildServiceAgentPoolResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolResourceCollection.java new file mode 100644 index 0000000000000..eef808069def4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of build service agent pool resources and a possible link for next set. */ +@Fluent +public final class BuildServiceAgentPoolResourceCollection { + /* + * Collection of build service agent pool resource + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BuildServiceAgentPoolResourceCollection class. */ + public BuildServiceAgentPoolResourceCollection() { + } + + /** + * Get the value property: Collection of build service agent pool resource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of build service agent pool resource. + * + * @param value the value value to set. + * @return the BuildServiceAgentPoolResourceCollection object itself. + */ + public BuildServiceAgentPoolResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BuildServiceAgentPoolResourceCollection object itself. + */ + public BuildServiceAgentPoolResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolSizeProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolSizeProperties.java new file mode 100644 index 0000000000000..bf88dbab3eac0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPoolSizeProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service agent pool size properties. */ +@Fluent +public final class BuildServiceAgentPoolSizeProperties { + /* + * The name of build service agent pool size + */ + @JsonProperty(value = "name") + private String name; + + /* + * The cpu property of build service agent pool size + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * The memory property of build service agent pool size + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /** Creates an instance of BuildServiceAgentPoolSizeProperties class. */ + public BuildServiceAgentPoolSizeProperties() { + } + + /** + * Get the name property: The name of build service agent pool size. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of build service agent pool size. + * + * @param name the name value to set. + * @return the BuildServiceAgentPoolSizeProperties object itself. + */ + public BuildServiceAgentPoolSizeProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the cpu property: The cpu property of build service agent pool size. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: The memory property of build service agent pool size. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPools.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPools.java new file mode 100644 index 0000000000000..4c2457a9310f0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPools.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.appplatform.generated.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.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; + +/** Resource collection API of BuildServiceAgentPools. */ +public interface BuildServiceAgentPools { + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of build service agent pool resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName, Context context); + + /** + * Get build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return build service agent pool. + */ + BuildServiceAgentPoolResource get( + String resourceGroupName, String serviceName, String buildServiceName, String agentPoolName); + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update 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 build service agent pool resource. + */ + BuildServiceAgentPoolResource updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource); + + /** + * Create or update build service agent pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param agentPoolName The name of the build service agent pool resource. + * @param agentPoolResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the build service agent pool resource. + */ + BuildServiceAgentPoolResource updatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceBuilders.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceBuilders.java new file mode 100644 index 0000000000000..12455b2bfc304 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceBuilders.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BuildServiceBuilders. */ +public interface BuildServiceBuilders { + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * Get a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder. + */ + BuilderResource get(String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Delete a KPack builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List KPack builders result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Builder resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids along with {@link Response}. + */ + Response listDeploymentsWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * List deployments that are using the builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments resource ids. + */ + DeploymentList listDeployments( + String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Get a KPack builder. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response}. + */ + BuilderResource getById(String id); + + /** + * Get a KPack builder. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack builder along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a KPack builder. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a KPack builder. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BuilderResource resource. + * + * @param name resource name. + * @return the first stage of the new BuilderResource definition. + */ + BuilderResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceCollection.java new file mode 100644 index 0000000000000..b209159c67e5c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Build service resources and a possible link for next set. */ +@Fluent +public final class BuildServiceCollection { + /* + * Collection of Build service resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BuildServiceCollection class. */ + public BuildServiceCollection() { + } + + /** + * Get the value property: Collection of Build service resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Build service resources. + * + * @param value the value value to set. + * @return the BuildServiceCollection object itself. + */ + public BuildServiceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BuildServiceCollection object itself. + */ + public BuildServiceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProperties.java new file mode 100644 index 0000000000000..96de49680230c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service resource properties payload. */ +@Fluent +public final class BuildServiceProperties { + /* + * The resource id of the container registry used in this build service. + */ + @JsonProperty(value = "containerRegistry") + private String containerRegistry; + + /* + * The installed KPack version in this build service. + */ + @JsonProperty(value = "kPackVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kPackVersion; + + /* + * Provisioning state of the KPack build service + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BuildServiceProvisioningState provisioningState; + + /* + * The runtime resource configuration of this build service. + */ + @JsonProperty(value = "resourceRequests") + private BuildServicePropertiesResourceRequests resourceRequests; + + /** Creates an instance of BuildServiceProperties class. */ + public BuildServiceProperties() { + } + + /** + * Get the containerRegistry property: The resource id of the container registry used in this build service. + * + * @return the containerRegistry value. + */ + public String containerRegistry() { + return this.containerRegistry; + } + + /** + * Set the containerRegistry property: The resource id of the container registry used in this build service. + * + * @param containerRegistry the containerRegistry value to set. + * @return the BuildServiceProperties object itself. + */ + public BuildServiceProperties withContainerRegistry(String containerRegistry) { + this.containerRegistry = containerRegistry; + return this; + } + + /** + * Get the kPackVersion property: The installed KPack version in this build service. + * + * @return the kPackVersion value. + */ + public String kPackVersion() { + return this.kPackVersion; + } + + /** + * Get the provisioningState property: Provisioning state of the KPack build service. + * + * @return the provisioningState value. + */ + public BuildServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceRequests property: The runtime resource configuration of this build service. + * + * @return the resourceRequests value. + */ + public BuildServicePropertiesResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Set the resourceRequests property: The runtime resource configuration of this build service. + * + * @param resourceRequests the resourceRequests value to set. + * @return the BuildServiceProperties object itself. + */ + public BuildServiceProperties withResourceRequests(BuildServicePropertiesResourceRequests resourceRequests) { + this.resourceRequests = resourceRequests; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServicePropertiesResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServicePropertiesResourceRequests.java new file mode 100644 index 0000000000000..cd090c96ad462 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServicePropertiesResourceRequests.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The runtime resource configuration of this build service. */ +@Immutable +public final class BuildServicePropertiesResourceRequests { + /* + * vCPU allocated to the entire build service node pool. + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory allocated to the entire build service node pool. + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /** Creates an instance of BuildServicePropertiesResourceRequests class. */ + public BuildServicePropertiesResourceRequests() { + } + + /** + * Get the cpu property: vCPU allocated to the entire build service node pool. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory allocated to the entire build service node pool. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProvisioningState.java new file mode 100644 index 0000000000000..b80dae191a9eb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the KPack build service. */ +public final class BuildServiceProvisioningState extends ExpandableStringEnum { + /** Static value Creating for BuildServiceProvisioningState. */ + public static final BuildServiceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for BuildServiceProvisioningState. */ + public static final BuildServiceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for BuildServiceProvisioningState. */ + public static final BuildServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BuildServiceProvisioningState. */ + public static final BuildServiceProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for BuildServiceProvisioningState. */ + public static final BuildServiceProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuildServiceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuildServiceProvisioningState() { + } + + /** + * Creates or finds a BuildServiceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuildServiceProvisioningState. + */ + @JsonCreator + public static BuildServiceProvisioningState fromString(String name) { + return fromString(name, BuildServiceProvisioningState.class); + } + + /** + * Gets known BuildServiceProvisioningState values. + * + * @return known BuildServiceProvisioningState values. + */ + public static Collection values() { + return values(BuildServiceProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServices.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServices.java new file mode 100644 index 0000000000000..bc307a10ad175 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServices.java @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BuildServices. */ +public interface BuildServices { + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listBuildServices(String resourceGroupName, String serviceName); + + /** + * List build services resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build service resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listBuildServices(String resourceGroupName, String serviceName, Context context); + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response}. + */ + Response getBuildServiceWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get a build service resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource. + */ + BuildService getBuildService(String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listBuilds(String resourceGroupName, String serviceName, String buildServiceName); + + /** + * List KPack builds. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listBuilds( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response}. + */ + Response getBuildWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * Get a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build. + */ + Build getBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBuild(String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * delete a KPack build. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBuild( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName); + + /** + * List KPack build results. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Build result resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listBuildResults( + String resourceGroupName, String serviceName, String buildServiceName, String buildName, Context context); + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result along with {@link Response}. + */ + Response getBuildResultWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context); + + /** + * Get a KPack build result. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result. + */ + BuildResult getBuildResult( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName); + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL along with {@link Response}. + */ + Response getBuildResultLogWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName, + Context context); + + /** + * Get a KPack build result log download URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildName The name of the build resource. + * @param buildResultName The name of the build result resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build result log download URL. + */ + BuildResultLog getBuildResultLog( + String resourceGroupName, + String serviceName, + String buildServiceName, + String buildName, + String buildResultName); + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive along with {@link + * Response}. + */ + Response getResourceUploadUrlWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get an resource upload URL for build service, which may be artifacts or source archive. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an resource upload URL for build service, which may be artifacts or source archive. + */ + ResourceUploadDefinition getResourceUploadUrl( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks along with {@link Response}. + */ + Response listSupportedBuildpacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get all supported buildpacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported buildpacks. + */ + SupportedBuildpacksCollection listSupportedBuildpacks( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource along with {@link Response}. + */ + Response getSupportedBuildpackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName, Context context); + + /** + * Get the supported buildpack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param buildpackName The name of the buildpack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported buildpack resource. + */ + SupportedBuildpackResource getSupportedBuildpack( + String resourceGroupName, String serviceName, String buildServiceName, String buildpackName); + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks along with {@link Response}. + */ + Response listSupportedStacksWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * Get all supported stacks. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all supported stacks. + */ + SupportedStacksCollection listSupportedStacks( + String resourceGroupName, String serviceName, String buildServiceName); + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource along with {@link Response}. + */ + Response getSupportedStackWithResponse( + String resourceGroupName, String serviceName, String buildServiceName, String stackName, Context context); + + /** + * Get the supported stack resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param stackName The name of the stack resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the supported stack resource. + */ + SupportedStackResource getSupportedStack( + String resourceGroupName, String serviceName, String buildServiceName, String stackName); + + /** + * Get a build service resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response}. + */ + BuildService getBuildServiceById(String id); + + /** + * Get a build service resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a build service resource along with {@link Response}. + */ + Response getBuildServiceByIdWithResponse(String id, Context context); + + /** + * Get a KPack build. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response}. + */ + Build getBuildById(String id); + + /** + * Get a KPack build. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a KPack build along with {@link Response}. + */ + Response getBuildByIdWithResponse(String id, Context context); + + /** + * delete a KPack build. + * + * @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 deleteBuildById(String id); + + /** + * delete a KPack build. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteBuildByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BuildService resource. + * + * @param name resource name. + * @return the first stage of the new BuildService definition. + */ + BuildService.DefinitionStages.Blank define(String name); + + /** + * Begins definition for a new Build resource. + * + * @param name resource name. + * @return the first stage of the new Build definition. + */ + Build.DefinitionStages.Blank defineBuild(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildStageProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildStageProperties.java new file mode 100644 index 0000000000000..f227c07eed665 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildStageProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The build stage (init-container and container) resources in build pod. */ +@Immutable +public final class BuildStageProperties { + /* + * The name of this build stage resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The provisioning state of this build stage resource. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private KPackBuildStageProvisioningState status; + + /* + * The exit code of this build init container. + */ + @JsonProperty(value = "exitCode", access = JsonProperty.Access.WRITE_ONLY) + private String exitCode; + + /* + * The reason of this build init container. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** Creates an instance of BuildStageProperties class. */ + public BuildStageProperties() { + } + + /** + * Get the name property: The name of this build stage resource. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: The provisioning state of this build stage resource. + * + * @return the status value. + */ + public KPackBuildStageProvisioningState status() { + return this.status; + } + + /** + * Get the exitCode property: The exit code of this build init container. + * + * @return the exitCode value. + */ + public String exitCode() { + return this.exitCode; + } + + /** + * Get the reason property: The reason of this build init container. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProperties.java new file mode 100644 index 0000000000000..b312e5c510d1a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** KPack Builder properties payload. */ +@Fluent +public final class BuilderProperties { + /* + * Builder provision status. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BuilderProvisioningState provisioningState; + + /* + * Builder cluster stack property. + */ + @JsonProperty(value = "stack") + private StackProperties stack; + + /* + * Builder buildpack groups. + */ + @JsonProperty(value = "buildpackGroups") + private List buildpackGroups; + + /** Creates an instance of BuilderProperties class. */ + public BuilderProperties() { + } + + /** + * Get the provisioningState property: Builder provision status. + * + * @return the provisioningState value. + */ + public BuilderProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the stack property: Builder cluster stack property. + * + * @return the stack value. + */ + public StackProperties stack() { + return this.stack; + } + + /** + * Set the stack property: Builder cluster stack property. + * + * @param stack the stack value to set. + * @return the BuilderProperties object itself. + */ + public BuilderProperties withStack(StackProperties stack) { + this.stack = stack; + return this; + } + + /** + * Get the buildpackGroups property: Builder buildpack groups. + * + * @return the buildpackGroups value. + */ + public List buildpackGroups() { + return this.buildpackGroups; + } + + /** + * Set the buildpackGroups property: Builder buildpack groups. + * + * @param buildpackGroups the buildpackGroups value to set. + * @return the BuilderProperties object itself. + */ + public BuilderProperties withBuildpackGroups(List buildpackGroups) { + this.buildpackGroups = buildpackGroups; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (stack() != null) { + stack().validate(); + } + if (buildpackGroups() != null) { + buildpackGroups().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProvisioningState.java new file mode 100644 index 0000000000000..a66ac7a8b473e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Builder provision status. */ +public final class BuilderProvisioningState extends ExpandableStringEnum { + /** Static value Creating for BuilderProvisioningState. */ + public static final BuilderProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for BuilderProvisioningState. */ + public static final BuilderProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for BuilderProvisioningState. */ + public static final BuilderProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BuilderProvisioningState. */ + public static final BuilderProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for BuilderProvisioningState. */ + public static final BuilderProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuilderProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuilderProvisioningState() { + } + + /** + * Creates or finds a BuilderProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuilderProvisioningState. + */ + @JsonCreator + public static BuilderProvisioningState fromString(String name) { + return fromString(name, BuilderProvisioningState.class); + } + + /** + * Gets known BuilderProvisioningState values. + * + * @return known BuilderProvisioningState values. + */ + public static Collection values() { + return values(BuilderProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResource.java new file mode 100644 index 0000000000000..94f83101465bb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResource.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; + +/** An immutable client-side representation of BuilderResource. */ +public interface BuilderResource { + /** + * 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 properties property: Property of the Builder resource. + * + * @return the properties value. + */ + BuilderProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner object. + * + * @return the inner object. + */ + BuilderResourceInner innerModel(); + + /** The entirety of the BuilderResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The BuilderResource definition stages. */ + interface DefinitionStages { + /** The first stage of the BuilderResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the BuilderResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, buildServiceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @return the next definition stage. + */ + WithCreate withExistingBuildService(String resourceGroupName, String serviceName, String buildServiceName); + } + + /** + * The stage of the BuilderResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + BuilderResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BuilderResource create(Context context); + } + + /** The stage of the BuilderResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Property of the Builder resource.. + * + * @param properties Property of the Builder resource. + * @return the next definition stage. + */ + WithCreate withProperties(BuilderProperties properties); + } + } + + /** + * Begins update for the BuilderResource resource. + * + * @return the stage of resource update. + */ + BuilderResource.Update update(); + + /** The template for BuilderResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BuilderResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BuilderResource apply(Context context); + } + + /** The BuilderResource update stages. */ + interface UpdateStages { + /** The stage of the BuilderResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Property of the Builder resource.. + * + * @param properties Property of the Builder resource. + * @return the next definition stage. + */ + Update withProperties(BuilderProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BuilderResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BuilderResource refresh(Context context); + + /** + * List deployments that are using the builder. + * + * @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 deployments resource ids along with {@link Response}. + */ + Response listDeploymentsWithResponse(Context context); + + /** + * List deployments that are using the builder. + * + * @throws com.azure.core.management.exception.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 deployments resource ids. + */ + DeploymentList listDeployments(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResourceCollection.java new file mode 100644 index 0000000000000..fc4691f3e0aaf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Builder resources and a possible link for next set. */ +@Fluent +public final class BuilderResourceCollection { + /* + * Collection of Builder resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BuilderResourceCollection class. */ + public BuilderResourceCollection() { + } + + /** + * Get the value property: Collection of Builder resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Builder resources. + * + * @param value the value value to set. + * @return the BuilderResourceCollection object itself. + */ + public BuilderResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BuilderResourceCollection object itself. + */ + public BuilderResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingLaunchProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingLaunchProperties.java new file mode 100644 index 0000000000000..96c67327c38c4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingLaunchProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Buildpack Binding Launch Properties. */ +@Fluent +public final class BuildpackBindingLaunchProperties { + /* + * Non-sensitive properties for launchProperties + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /* + * Sensitive properties for launchProperties + */ + @JsonProperty(value = "secrets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map secrets; + + /** Creates an instance of BuildpackBindingLaunchProperties class. */ + public BuildpackBindingLaunchProperties() { + } + + /** + * Get the properties property: Non-sensitive properties for launchProperties. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Non-sensitive properties for launchProperties. + * + * @param properties the properties value to set. + * @return the BuildpackBindingLaunchProperties object itself. + */ + public BuildpackBindingLaunchProperties withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the secrets property: Sensitive properties for launchProperties. + * + * @return the secrets value. + */ + public Map secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Sensitive properties for launchProperties. + * + * @param secrets the secrets value to set. + * @return the BuildpackBindingLaunchProperties object itself. + */ + public BuildpackBindingLaunchProperties withSecrets(Map secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProperties.java new file mode 100644 index 0000000000000..91ef28e2bb18b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a buildpack binding. */ +@Fluent +public final class BuildpackBindingProperties { + /* + * Buildpack Binding Type + */ + @JsonProperty(value = "bindingType") + private BindingType bindingType; + + /* + * State of the Buildpack Binding. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private BuildpackBindingProvisioningState provisioningState; + + /* + * The object describes the buildpack binding launch properties + */ + @JsonProperty(value = "launchProperties") + private BuildpackBindingLaunchProperties launchProperties; + + /** Creates an instance of BuildpackBindingProperties class. */ + public BuildpackBindingProperties() { + } + + /** + * Get the bindingType property: Buildpack Binding Type. + * + * @return the bindingType value. + */ + public BindingType bindingType() { + return this.bindingType; + } + + /** + * Set the bindingType property: Buildpack Binding Type. + * + * @param bindingType the bindingType value to set. + * @return the BuildpackBindingProperties object itself. + */ + public BuildpackBindingProperties withBindingType(BindingType bindingType) { + this.bindingType = bindingType; + return this; + } + + /** + * Get the provisioningState property: State of the Buildpack Binding. + * + * @return the provisioningState value. + */ + public BuildpackBindingProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the launchProperties property: The object describes the buildpack binding launch properties. + * + * @return the launchProperties value. + */ + public BuildpackBindingLaunchProperties launchProperties() { + return this.launchProperties; + } + + /** + * Set the launchProperties property: The object describes the buildpack binding launch properties. + * + * @param launchProperties the launchProperties value to set. + * @return the BuildpackBindingProperties object itself. + */ + public BuildpackBindingProperties withLaunchProperties(BuildpackBindingLaunchProperties launchProperties) { + this.launchProperties = launchProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (launchProperties() != null) { + launchProperties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProvisioningState.java new file mode 100644 index 0000000000000..f613e738355f2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Buildpack Binding. */ +public final class BuildpackBindingProvisioningState extends ExpandableStringEnum { + /** Static value Creating for BuildpackBindingProvisioningState. */ + public static final BuildpackBindingProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for BuildpackBindingProvisioningState. */ + public static final BuildpackBindingProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for BuildpackBindingProvisioningState. */ + public static final BuildpackBindingProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BuildpackBindingProvisioningState. */ + public static final BuildpackBindingProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for BuildpackBindingProvisioningState. */ + public static final BuildpackBindingProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of BuildpackBindingProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuildpackBindingProvisioningState() { + } + + /** + * Creates or finds a BuildpackBindingProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuildpackBindingProvisioningState. + */ + @JsonCreator + public static BuildpackBindingProvisioningState fromString(String name) { + return fromString(name, BuildpackBindingProvisioningState.class); + } + + /** + * Gets known BuildpackBindingProvisioningState values. + * + * @return known BuildpackBindingProvisioningState values. + */ + public static Collection values() { + return values(BuildpackBindingProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResource.java new file mode 100644 index 0000000000000..0a970ca56605d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResource.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner; + +/** An immutable client-side representation of BuildpackBindingResource. */ +public interface BuildpackBindingResource { + /** + * 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 properties property: Properties of a buildpack binding. + * + * @return the properties value. + */ + BuildpackBindingProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner + * object. + * + * @return the inner object. + */ + BuildpackBindingResourceInner innerModel(); + + /** The entirety of the BuildpackBindingResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The BuildpackBindingResource definition stages. */ + interface DefinitionStages { + /** The first stage of the BuildpackBindingResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the BuildpackBindingResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, buildServiceName, builderName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @return the next definition stage. + */ + WithCreate withExistingBuilder( + String resourceGroupName, String serviceName, String buildServiceName, String builderName); + } + + /** + * The stage of the BuildpackBindingResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + BuildpackBindingResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BuildpackBindingResource create(Context context); + } + + /** The stage of the BuildpackBindingResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of a buildpack binding. + * + * @param properties Properties of a buildpack binding. + * @return the next definition stage. + */ + WithCreate withProperties(BuildpackBindingProperties properties); + } + } + + /** + * Begins update for the BuildpackBindingResource resource. + * + * @return the stage of resource update. + */ + BuildpackBindingResource.Update update(); + + /** The template for BuildpackBindingResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BuildpackBindingResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BuildpackBindingResource apply(Context context); + } + + /** The BuildpackBindingResource update stages. */ + interface UpdateStages { + /** The stage of the BuildpackBindingResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of a buildpack binding. + * + * @param properties Properties of a buildpack binding. + * @return the next definition stage. + */ + Update withProperties(BuildpackBindingProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BuildpackBindingResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BuildpackBindingResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResourceCollection.java new file mode 100644 index 0000000000000..780ca2c8d50d1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of BuildpackBinding resources and a possible link for next set. */ +@Fluent +public final class BuildpackBindingResourceCollection { + /* + * Collection of BuildpackBinding resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of BuildpackBindingResourceCollection class. */ + public BuildpackBindingResourceCollection() { + } + + /** + * Get the value property: Collection of BuildpackBinding resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of BuildpackBinding resources. + * + * @param value the value value to set. + * @return the BuildpackBindingResourceCollection object itself. + */ + public BuildpackBindingResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the BuildpackBindingResourceCollection object itself. + */ + public BuildpackBindingResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindings.java new file mode 100644 index 0000000000000..1fbad77af56f2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindings.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BuildpackBindings. */ +public interface BuildpackBindings { + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedIterable}. + */ + PagedIterable listForCluster(String resourceGroupName, String serviceName); + + /** + * Get collection of buildpack bindings under all builders. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of buildpack bindings under all builders as paginated response with {@link PagedIterable}. + */ + PagedIterable listForCluster( + String resourceGroupName, String serviceName, Context context); + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 a buildpack binding by name along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context); + + /** + * Get a buildpack binding by name. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 a buildpack binding by name. + */ + BuildpackBindingResource get( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName); + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName); + + /** + * Operation to delete a Buildpack Binding. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param buildpackBindingName The name of the Buildpack Binding 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 delete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context); + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName); + + /** + * Handles requests to list all buildpack bindings in a builder. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param buildServiceName The name of the build service resource. + * @param builderName The name of the builder resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of BuildpackBinding resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context); + + /** + * Get a buildpack binding by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a buildpack binding by name along with {@link Response}. + */ + BuildpackBindingResource getById(String id); + + /** + * Get a buildpack binding by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a buildpack binding by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete a Buildpack Binding. + * + * @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); + + /** + * Operation to delete a Buildpack Binding. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BuildpackBindingResource resource. + * + * @param name resource name. + * @return the first stage of the new BuildpackBindingResource definition. + */ + BuildpackBindingResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackProperties.java new file mode 100644 index 0000000000000..3a288c0c6c0be --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Buildpack properties payload. */ +@Fluent +public final class BuildpackProperties { + /* + * Id of the buildpack + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of BuildpackProperties class. */ + public BuildpackProperties() { + } + + /** + * Get the id property: Id of the buildpack. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the buildpack. + * + * @param id the id value to set. + * @return the BuildpackProperties object itself. + */ + public BuildpackProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpacksGroupProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpacksGroupProperties.java new file mode 100644 index 0000000000000..07ef64463cb17 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpacksGroupProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Buildpack group properties of the Builder. */ +@Fluent +public final class BuildpacksGroupProperties { + /* + * Buildpack group name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Buildpacks in the buildpack group + */ + @JsonProperty(value = "buildpacks") + private List buildpacks; + + /** Creates an instance of BuildpacksGroupProperties class. */ + public BuildpacksGroupProperties() { + } + + /** + * Get the name property: Buildpack group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Buildpack group name. + * + * @param name the name value to set. + * @return the BuildpacksGroupProperties object itself. + */ + public BuildpacksGroupProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the buildpacks property: Buildpacks in the buildpack group. + * + * @return the buildpacks value. + */ + public List buildpacks() { + return this.buildpacks; + } + + /** + * Set the buildpacks property: Buildpacks in the buildpack group. + * + * @param buildpacks the buildpacks value to set. + * @return the BuildpacksGroupProperties object itself. + */ + public BuildpacksGroupProperties withBuildpacks(List buildpacks) { + this.buildpacks = buildpacks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (buildpacks() != null) { + buildpacks().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateProperties.java new file mode 100644 index 0000000000000..963e62fbeabfb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Certificate resource payload. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = CertificateProperties.class) +@JsonTypeName("CertificateProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "KeyVaultCertificate", value = KeyVaultCertificateProperties.class), + @JsonSubTypes.Type(name = "ContentCertificate", value = ContentCertificateProperties.class) +}) +@Immutable +public class CertificateProperties { + /* + * The thumbprint of certificate. + */ + @JsonProperty(value = "thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /* + * The issuer of certificate. + */ + @JsonProperty(value = "issuer", access = JsonProperty.Access.WRITE_ONLY) + private String issuer; + + /* + * The issue date of certificate. + */ + @JsonProperty(value = "issuedDate", access = JsonProperty.Access.WRITE_ONLY) + private String issuedDate; + + /* + * The expiration date of certificate. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private String expirationDate; + + /* + * The activate date of certificate. + */ + @JsonProperty(value = "activateDate", access = JsonProperty.Access.WRITE_ONLY) + private String activateDate; + + /* + * The subject name of certificate. + */ + @JsonProperty(value = "subjectName", access = JsonProperty.Access.WRITE_ONLY) + private String subjectName; + + /* + * The domain list of certificate. + */ + @JsonProperty(value = "dnsNames", access = JsonProperty.Access.WRITE_ONLY) + private List dnsNames; + + /* + * Provisioning state of the Certificate + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CertificateResourceProvisioningState provisioningState; + + /** Creates an instance of CertificateProperties class. */ + public CertificateProperties() { + } + + /** + * Get the thumbprint property: The thumbprint of certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Get the issuer property: The issuer of certificate. + * + * @return the issuer value. + */ + public String issuer() { + return this.issuer; + } + + /** + * Get the issuedDate property: The issue date of certificate. + * + * @return the issuedDate value. + */ + public String issuedDate() { + return this.issuedDate; + } + + /** + * Get the expirationDate property: The expiration date of certificate. + * + * @return the expirationDate value. + */ + public String expirationDate() { + return this.expirationDate; + } + + /** + * Get the activateDate property: The activate date of certificate. + * + * @return the activateDate value. + */ + public String activateDate() { + return this.activateDate; + } + + /** + * Get the subjectName property: The subject name of certificate. + * + * @return the subjectName value. + */ + public String subjectName() { + return this.subjectName; + } + + /** + * Get the dnsNames property: The domain list of certificate. + * + * @return the dnsNames value. + */ + public List dnsNames() { + return this.dnsNames; + } + + /** + * Get the provisioningState property: Provisioning state of the Certificate. + * + * @return the provisioningState value. + */ + public CertificateResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateReference.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateReference.java new file mode 100644 index 0000000000000..4064aa88827eb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateReference.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A reference to the certificate. */ +@Fluent +public final class CertificateReference { + /* + * Resource Id of the certificate + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** Creates an instance of CertificateReference class. */ + public CertificateReference() { + } + + /** + * Get the resourceId property: Resource Id of the certificate. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id of the certificate. + * + * @param resourceId the resourceId value to set. + * @return the CertificateReference object itself. + */ + public CertificateReference withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model CertificateReference")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CertificateReference.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResource.java new file mode 100644 index 0000000000000..5875b408eca30 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResource.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner; + +/** An immutable client-side representation of CertificateResource. */ +public interface CertificateResource { + /** + * 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 properties property: Properties of the certificate resource payload. + * + * @return the properties value. + */ + CertificateProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner object. + * + * @return the inner object. + */ + CertificateResourceInner innerModel(); + + /** The entirety of the CertificateResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The CertificateResource definition stages. */ + interface DefinitionStages { + /** The first stage of the CertificateResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the CertificateResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the CertificateResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CertificateResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CertificateResource create(Context context); + } + + /** The stage of the CertificateResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the certificate resource payload.. + * + * @param properties Properties of the certificate resource payload. + * @return the next definition stage. + */ + WithCreate withProperties(CertificateProperties properties); + } + } + + /** + * Begins update for the CertificateResource resource. + * + * @return the stage of resource update. + */ + CertificateResource.Update update(); + + /** The template for CertificateResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CertificateResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CertificateResource apply(Context context); + } + + /** The CertificateResource update stages. */ + interface UpdateStages { + /** The stage of the CertificateResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the certificate resource payload.. + * + * @param properties Properties of the certificate resource payload. + * @return the next definition stage. + */ + Update withProperties(CertificateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CertificateResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CertificateResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResourceCollection.java new file mode 100644 index 0000000000000..7fbd7f9b63e6a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResourceCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection compose of certificate resources list and a possible link for next page. */ +@Fluent +public final class CertificateResourceCollection { + /* + * The certificate resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of certificate list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CertificateResourceCollection class. */ + public CertificateResourceCollection() { + } + + /** + * Get the value property: The certificate resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The certificate resources list. + * + * @param value the value value to set. + * @return the CertificateResourceCollection object itself. + */ + public CertificateResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of certificate list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of certificate list. + * + * @param nextLink the nextLink value to set. + * @return the CertificateResourceCollection object itself. + */ + public CertificateResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResourceProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResourceProvisioningState.java new file mode 100644 index 0000000000000..db1a432d6fcc1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResourceProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the Certificate. */ +public final class CertificateResourceProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for CertificateResourceProvisioningState. */ + public static final CertificateResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for CertificateResourceProvisioningState. */ + public static final CertificateResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for CertificateResourceProvisioningState. */ + public static final CertificateResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CertificateResourceProvisioningState. */ + public static final CertificateResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for CertificateResourceProvisioningState. */ + public static final CertificateResourceProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of CertificateResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CertificateResourceProvisioningState() { + } + + /** + * Creates or finds a CertificateResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CertificateResourceProvisioningState. + */ + @JsonCreator + public static CertificateResourceProvisioningState fromString(String name) { + return fromString(name, CertificateResourceProvisioningState.class); + } + + /** + * Gets known CertificateResourceProvisioningState values. + * + * @return known CertificateResourceProvisioningState values. + */ + public static Collection values() { + return values(CertificateResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Certificates.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Certificates.java new file mode 100644 index 0000000000000..47a4d1b7e24d1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Certificates.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Certificates. */ +public interface Certificates { + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String certificateName, Context context); + + /** + * Get the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the certificate resource. + */ + CertificateResource get(String resourceGroupName, String serviceName, String certificateName); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String certificateName); + + /** + * Delete the certificate resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param certificateName The name of the certificate resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String certificateName, Context context); + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List all the certificates of one user. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of certificate resources list and a possible link for next page as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the certificate resource. + * + * @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 certificate resource along with {@link Response}. + */ + CertificateResource getById(String id); + + /** + * Get the certificate resource. + * + * @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 certificate resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the certificate resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the certificate resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CertificateResource resource. + * + * @param name resource name. + * @return the first stage of the new CertificateResource definition. + */ + CertificateResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ClusterResourceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ClusterResourceProperties.java new file mode 100644 index 0000000000000..52bde2e98ef6a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ClusterResourceProperties.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Service properties payload. */ +@Fluent +public final class ClusterResourceProperties { + /* + * Provisioning state of the Service + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Network profile of the Service + */ + @JsonProperty(value = "networkProfile") + private NetworkProfile networkProfile; + + /* + * Additional Service settings in vnet injection instance + */ + @JsonProperty(value = "vnetAddons") + private ServiceVNetAddons vnetAddons; + + /* + * Additional Service settings for planned maintenance + */ + @JsonProperty(value = "maintenanceScheduleConfiguration") + private MaintenanceScheduleConfiguration maintenanceScheduleConfiguration; + + /* + * Version of the Service + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private Integer version; + + /* + * ServiceInstanceEntity Id which uniquely identifies a created resource + */ + @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceId; + + /* + * The resource Id of the Managed Environment that the Spring Apps instance builds on + */ + @JsonProperty(value = "managedEnvironmentId") + private String managedEnvironmentId; + + /* + * The name of the resource group that contains the infrastructure resources + */ + @JsonProperty(value = "infraResourceGroup") + private String infraResourceGroup; + + /* + * Power state of the Service + */ + @JsonProperty(value = "powerState", access = JsonProperty.Access.WRITE_ONLY) + private PowerState powerState; + + /* + * The zoneRedundant property. + */ + @JsonProperty(value = "zoneRedundant") + private Boolean zoneRedundant; + + /* + * Fully qualified dns name of the service instance + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Purchasing 3rd party product of the Service resource. + */ + @JsonProperty(value = "marketplaceResource") + private MarketplaceResource marketplaceResource; + + /** Creates an instance of ClusterResourceProperties class. */ + public ClusterResourceProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Service. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the networkProfile property: Network profile of the Service. + * + * @return the networkProfile value. + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile property: Network profile of the Service. + * + * @param networkProfile the networkProfile value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the vnetAddons property: Additional Service settings in vnet injection instance. + * + * @return the vnetAddons value. + */ + public ServiceVNetAddons vnetAddons() { + return this.vnetAddons; + } + + /** + * Set the vnetAddons property: Additional Service settings in vnet injection instance. + * + * @param vnetAddons the vnetAddons value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withVnetAddons(ServiceVNetAddons vnetAddons) { + this.vnetAddons = vnetAddons; + return this; + } + + /** + * Get the maintenanceScheduleConfiguration property: Additional Service settings for planned maintenance. + * + * @return the maintenanceScheduleConfiguration value. + */ + public MaintenanceScheduleConfiguration maintenanceScheduleConfiguration() { + return this.maintenanceScheduleConfiguration; + } + + /** + * Set the maintenanceScheduleConfiguration property: Additional Service settings for planned maintenance. + * + * @param maintenanceScheduleConfiguration the maintenanceScheduleConfiguration value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withMaintenanceScheduleConfiguration( + MaintenanceScheduleConfiguration maintenanceScheduleConfiguration) { + this.maintenanceScheduleConfiguration = maintenanceScheduleConfiguration; + return this; + } + + /** + * Get the version property: Version of the Service. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Get the serviceId property: ServiceInstanceEntity Id which uniquely identifies a created resource. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Get the managedEnvironmentId property: The resource Id of the Managed Environment that the Spring Apps instance + * builds on. + * + * @return the managedEnvironmentId value. + */ + public String managedEnvironmentId() { + return this.managedEnvironmentId; + } + + /** + * Set the managedEnvironmentId property: The resource Id of the Managed Environment that the Spring Apps instance + * builds on. + * + * @param managedEnvironmentId the managedEnvironmentId value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withManagedEnvironmentId(String managedEnvironmentId) { + this.managedEnvironmentId = managedEnvironmentId; + return this; + } + + /** + * Get the infraResourceGroup property: The name of the resource group that contains the infrastructure resources. + * + * @return the infraResourceGroup value. + */ + public String infraResourceGroup() { + return this.infraResourceGroup; + } + + /** + * Set the infraResourceGroup property: The name of the resource group that contains the infrastructure resources. + * + * @param infraResourceGroup the infraResourceGroup value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withInfraResourceGroup(String infraResourceGroup) { + this.infraResourceGroup = infraResourceGroup; + return this; + } + + /** + * Get the powerState property: Power state of the Service. + * + * @return the powerState value. + */ + public PowerState powerState() { + return this.powerState; + } + + /** + * Get the zoneRedundant property: The zoneRedundant property. + * + * @return the zoneRedundant value. + */ + public Boolean zoneRedundant() { + return this.zoneRedundant; + } + + /** + * Set the zoneRedundant property: The zoneRedundant property. + * + * @param zoneRedundant the zoneRedundant value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withZoneRedundant(Boolean zoneRedundant) { + this.zoneRedundant = zoneRedundant; + return this; + } + + /** + * Get the fqdn property: Fully qualified dns name of the service instance. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the marketplaceResource property: Purchasing 3rd party product of the Service resource. + * + * @return the marketplaceResource value. + */ + public MarketplaceResource marketplaceResource() { + return this.marketplaceResource; + } + + /** + * Set the marketplaceResource property: Purchasing 3rd party product of the Service resource. + * + * @param marketplaceResource the marketplaceResource value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withMarketplaceResource(MarketplaceResource marketplaceResource) { + this.marketplaceResource = marketplaceResource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkProfile() != null) { + networkProfile().validate(); + } + if (vnetAddons() != null) { + vnetAddons().validate(); + } + if (maintenanceScheduleConfiguration() != null) { + maintenanceScheduleConfiguration().validate(); + } + if (marketplaceResource() != null) { + marketplaceResource().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerEnabledState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerEnabledState.java new file mode 100644 index 0000000000000..fe0f9b830e831 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerEnabledState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enabled state of the config server. This is only used in Consumption tier. */ +public final class ConfigServerEnabledState extends ExpandableStringEnum { + /** Static value Enabled for ConfigServerEnabledState. */ + public static final ConfigServerEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for ConfigServerEnabledState. */ + public static final ConfigServerEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ConfigServerEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigServerEnabledState() { + } + + /** + * Creates or finds a ConfigServerEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigServerEnabledState. + */ + @JsonCreator + public static ConfigServerEnabledState fromString(String name) { + return fromString(name, ConfigServerEnabledState.class); + } + + /** + * Gets known ConfigServerEnabledState values. + * + * @return known ConfigServerEnabledState values. + */ + public static Collection values() { + return values(ConfigServerEnabledState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerGitProperty.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerGitProperty.java new file mode 100644 index 0000000000000..68a16e0cb7193 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerGitProperty.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Property of git. */ +@Fluent +public final class ConfigServerGitProperty { + /* + * Repositories of git. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label") + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** Creates an instance of ConfigServerGitProperty class. */ + public ConfigServerGitProperty() { + } + + /** + * Get the repositories property: Repositories of git. + * + * @return the repositories value. + */ + public List repositories() { + return this.repositories; + } + + /** + * Set the repositories property: Repositories of git. + * + * @param repositories the repositories value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withRepositories(List repositories) { + this.repositories = repositories; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the ConfigServerGitProperty object itself. + */ + public ConfigServerGitProperty withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositories() != null) { + repositories().forEach(e -> e.validate()); + } + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model ConfigServerGitProperty")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigServerGitProperty.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerProperties.java new file mode 100644 index 0000000000000..5d402f80ccad7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Config server git properties payload. */ +@Fluent +public final class ConfigServerProperties { + /* + * State of the config server. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ConfigServerState provisioningState; + + /* + * Error when apply config server settings. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Enabled state of the config server. This is only used in Consumption tier. + */ + @JsonProperty(value = "enabledState") + private ConfigServerEnabledState enabledState; + + /* + * Settings of config server. + */ + @JsonProperty(value = "configServer") + private ConfigServerSettings configServer; + + /** Creates an instance of ConfigServerProperties class. */ + public ConfigServerProperties() { + } + + /** + * Get the provisioningState property: State of the config server. + * + * @return the provisioningState value. + */ + public ConfigServerState provisioningState() { + return this.provisioningState; + } + + /** + * Get the error property: Error when apply config server settings. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when apply config server settings. + * + * @param error the error value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the enabledState property: Enabled state of the config server. This is only used in Consumption tier. + * + * @return the enabledState value. + */ + public ConfigServerEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Enabled state of the config server. This is only used in Consumption tier. + * + * @param enabledState the enabledState value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withEnabledState(ConfigServerEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the configServer property: Settings of config server. + * + * @return the configServer value. + */ + public ConfigServerSettings configServer() { + return this.configServer; + } + + /** + * Set the configServer property: Settings of config server. + * + * @param configServer the configServer value to set. + * @return the ConfigServerProperties object itself. + */ + public ConfigServerProperties withConfigServer(ConfigServerSettings configServer) { + this.configServer = configServer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (configServer() != null) { + configServer().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerResource.java new file mode 100644 index 0000000000000..02cb63ce84a12 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; + +/** An immutable client-side representation of ConfigServerResource. */ +public interface ConfigServerResource { + /** + * 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 properties property: Properties of the Config Server resource. + * + * @return the properties value. + */ + ConfigServerProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner object. + * + * @return the inner object. + */ + ConfigServerResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettings.java new file mode 100644 index 0000000000000..f56ac7306c7fe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettings.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The settings of config server. */ +@Fluent +public final class ConfigServerSettings { + /* + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigServerGitProperty gitProperty; + + /** Creates an instance of ConfigServerSettings class. */ + public ConfigServerSettings() { + } + + /** + * Get the gitProperty property: Property of git environment. + * + * @return the gitProperty value. + */ + public ConfigServerGitProperty gitProperty() { + return this.gitProperty; + } + + /** + * Set the gitProperty property: Property of git environment. + * + * @param gitProperty the gitProperty value to set. + * @return the ConfigServerSettings object itself. + */ + public ConfigServerSettings withGitProperty(ConfigServerGitProperty gitProperty) { + this.gitProperty = gitProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitProperty() != null) { + gitProperty().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettingsErrorRecord.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettingsErrorRecord.java new file mode 100644 index 0000000000000..b5efe6bcafb78 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettingsErrorRecord.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Error record of the config server settings. */ +@Fluent +public final class ConfigServerSettingsErrorRecord { + /* + * The name of the config server settings error record + */ + @JsonProperty(value = "name") + private String name; + + /* + * The uri of the config server settings error record + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * The detail error messages of the record + */ + @JsonProperty(value = "messages") + private List messages; + + /** Creates an instance of ConfigServerSettingsErrorRecord class. */ + public ConfigServerSettingsErrorRecord() { + } + + /** + * Get the name property: The name of the config server settings error record. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the config server settings error record. + * + * @param name the name value to set. + * @return the ConfigServerSettingsErrorRecord object itself. + */ + public ConfigServerSettingsErrorRecord withName(String name) { + this.name = name; + return this; + } + + /** + * Get the uri property: The uri of the config server settings error record. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The uri of the config server settings error record. + * + * @param uri the uri value to set. + * @return the ConfigServerSettingsErrorRecord object itself. + */ + public ConfigServerSettingsErrorRecord withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the messages property: The detail error messages of the record. + * + * @return the messages value. + */ + public List messages() { + return this.messages; + } + + /** + * Set the messages property: The detail error messages of the record. + * + * @param messages the messages value to set. + * @return the ConfigServerSettingsErrorRecord object itself. + */ + public ConfigServerSettingsErrorRecord withMessages(List messages) { + this.messages = messages; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettingsValidateResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettingsValidateResult.java new file mode 100644 index 0000000000000..392d793af08da --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerSettingsValidateResult.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerSettingsValidateResultInner; +import java.util.List; + +/** An immutable client-side representation of ConfigServerSettingsValidateResult. */ +public interface ConfigServerSettingsValidateResult { + /** + * Gets the isValid property: Indicate if the config server settings are valid. + * + * @return the isValid value. + */ + Boolean isValid(); + + /** + * Gets the details property: The detail validation results. + * + * @return the details value. + */ + List details(); + + /** + * Gets the inner + * com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerSettingsValidateResultInner object. + * + * @return the inner object. + */ + ConfigServerSettingsValidateResultInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerState.java new file mode 100644 index 0000000000000..e754922fa708c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the config server. */ +public final class ConfigServerState extends ExpandableStringEnum { + /** Static value NotAvailable for ConfigServerState. */ + public static final ConfigServerState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Deleted for ConfigServerState. */ + public static final ConfigServerState DELETED = fromString("Deleted"); + + /** Static value Failed for ConfigServerState. */ + public static final ConfigServerState FAILED = fromString("Failed"); + + /** Static value Succeeded for ConfigServerState. */ + public static final ConfigServerState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for ConfigServerState. */ + public static final ConfigServerState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of ConfigServerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigServerState() { + } + + /** + * Creates or finds a ConfigServerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigServerState. + */ + @JsonCreator + public static ConfigServerState fromString(String name) { + return fromString(name, ConfigServerState.class); + } + + /** + * Gets known ConfigServerState values. + * + * @return known ConfigServerState values. + */ + public static Collection values() { + return values(ConfigServerState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServers.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServers.java new file mode 100644 index 0000000000000..8cb443951dc68 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServers.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; + +/** Resource collection API of ConfigServers. */ +public interface ConfigServers { + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get the config server and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the config server and its properties. + */ + ConfigServerResource get(String resourceGroupName, String serviceName); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update 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 config Server resource. + */ + ConfigServerResource updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + ConfigServerResource updatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update 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 config Server resource. + */ + ConfigServerResource updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource); + + /** + * Update the config server. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return config Server resource. + */ + ConfigServerResource updatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context); + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for config server settings. + */ + ConfigServerSettingsValidateResult validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings); + + /** + * Check if the config server settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configServerSettings Config server settings to be validated. + * @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 validation result for config server settings. + */ + ConfigServerSettingsValidateResult validate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGeneration.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGeneration.java new file mode 100644 index 0000000000000..3b4677af1e842 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGeneration.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The generation of the Application Configuration Service. */ +public final class ConfigurationServiceGeneration extends ExpandableStringEnum { + /** Static value Gen1 for ConfigurationServiceGeneration. */ + public static final ConfigurationServiceGeneration GEN1 = fromString("Gen1"); + + /** Static value Gen2 for ConfigurationServiceGeneration. */ + public static final ConfigurationServiceGeneration GEN2 = fromString("Gen2"); + + /** + * Creates a new instance of ConfigurationServiceGeneration value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationServiceGeneration() { + } + + /** + * Creates or finds a ConfigurationServiceGeneration from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationServiceGeneration. + */ + @JsonCreator + public static ConfigurationServiceGeneration fromString(String name) { + return fromString(name, ConfigurationServiceGeneration.class); + } + + /** + * Gets known ConfigurationServiceGeneration values. + * + * @return known ConfigurationServiceGeneration values. + */ + public static Collection values() { + return values(ConfigurationServiceGeneration.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitProperty.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitProperty.java new file mode 100644 index 0000000000000..6bf8968c8fea4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitProperty.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Property of git environment. */ +@Fluent +public final class ConfigurationServiceGitProperty { + /* + * Repositories of Application Configuration Service git property. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /** Creates an instance of ConfigurationServiceGitProperty class. */ + public ConfigurationServiceGitProperty() { + } + + /** + * Get the repositories property: Repositories of Application Configuration Service git property. + * + * @return the repositories value. + */ + public List repositories() { + return this.repositories; + } + + /** + * Set the repositories property: Repositories of Application Configuration Service git property. + * + * @param repositories the repositories value to set. + * @return the ConfigurationServiceGitProperty object itself. + */ + public ConfigurationServiceGitProperty withRepositories(List repositories) { + this.repositories = repositories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (repositories() != null) { + repositories().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitPropertyValidateResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitPropertyValidateResult.java new file mode 100644 index 0000000000000..1d3bf4feb510f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitPropertyValidateResult.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validation result for configuration service settings. */ +@Fluent +public final class ConfigurationServiceGitPropertyValidateResult { + /* + * Indicate if the configuration service settings are valid + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * The detail validation results + */ + @JsonProperty(value = "gitReposValidationResult") + private List gitReposValidationResult; + + /** Creates an instance of ConfigurationServiceGitPropertyValidateResult class. */ + public ConfigurationServiceGitPropertyValidateResult() { + } + + /** + * Get the isValid property: Indicate if the configuration service settings are valid. + * + * @return the isValid value. + */ + public Boolean isValid() { + return this.isValid; + } + + /** + * Set the isValid property: Indicate if the configuration service settings are valid. + * + * @param isValid the isValid value to set. + * @return the ConfigurationServiceGitPropertyValidateResult object itself. + */ + public ConfigurationServiceGitPropertyValidateResult withIsValid(Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Get the gitReposValidationResult property: The detail validation results. + * + * @return the gitReposValidationResult value. + */ + public List gitReposValidationResult() { + return this.gitReposValidationResult; + } + + /** + * Set the gitReposValidationResult property: The detail validation results. + * + * @param gitReposValidationResult the gitReposValidationResult value to set. + * @return the ConfigurationServiceGitPropertyValidateResult object itself. + */ + public ConfigurationServiceGitPropertyValidateResult withGitReposValidationResult( + List gitReposValidationResult) { + this.gitReposValidationResult = gitReposValidationResult; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitReposValidationResult() != null) { + gitReposValidationResult().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitRepository.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitRepository.java new file mode 100644 index 0000000000000..fc560674f5add --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitRepository.java @@ -0,0 +1,390 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Git repository property payload for Application Configuration Service. */ +@Fluent +public final class ConfigurationServiceGitRepository { + /* + * Name of the repository + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Collection of patterns of the repository + */ + @JsonProperty(value = "patterns", required = true) + private List patterns; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label", required = true) + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /* + * Git libraries used to support various repository providers + */ + @JsonProperty(value = "gitImplementation") + private GitImplementation gitImplementation; + + /* + * Resource Id of CA certificate for https URL of Git repository. + */ + @JsonProperty(value = "caCertResourceId") + private String caCertResourceId; + + /** Creates an instance of ConfigurationServiceGitRepository class. */ + public ConfigurationServiceGitRepository() { + } + + /** + * Get the name property: Name of the repository. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the repository. + * + * @param name the name value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withName(String name) { + this.name = name; + return this; + } + + /** + * Get the patterns property: Collection of patterns of the repository. + * + * @return the patterns value. + */ + public List patterns() { + return this.patterns; + } + + /** + * Set the patterns property: Collection of patterns of the repository. + * + * @param patterns the patterns value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withPatterns(List patterns) { + this.patterns = patterns; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + return this; + } + + /** + * Get the gitImplementation property: Git libraries used to support various repository providers. + * + * @return the gitImplementation value. + */ + public GitImplementation gitImplementation() { + return this.gitImplementation; + } + + /** + * Set the gitImplementation property: Git libraries used to support various repository providers. + * + * @param gitImplementation the gitImplementation value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withGitImplementation(GitImplementation gitImplementation) { + this.gitImplementation = gitImplementation; + return this; + } + + /** + * Get the caCertResourceId property: Resource Id of CA certificate for https URL of Git repository. + * + * @return the caCertResourceId value. + */ + public String caCertResourceId() { + return this.caCertResourceId; + } + + /** + * Set the caCertResourceId property: Resource Id of CA certificate for https URL of Git repository. + * + * @param caCertResourceId the caCertResourceId value to set. + * @return the ConfigurationServiceGitRepository object itself. + */ + public ConfigurationServiceGitRepository withCaCertResourceId(String caCertResourceId) { + this.caCertResourceId = caCertResourceId; + 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 ConfigurationServiceGitRepository")); + } + if (patterns() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property patterns in model ConfigurationServiceGitRepository")); + } + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property uri in model ConfigurationServiceGitRepository")); + } + if (label() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property label in model ConfigurationServiceGitRepository")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationServiceGitRepository.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceInstance.java new file mode 100644 index 0000000000000..45cad4d450459 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Application Configuration Service. */ +@Immutable +public final class ConfigurationServiceInstance { + /* + * Name of the Application Configuration Service instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the Application Configuration Service instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ConfigurationServiceInstance class. */ + public ConfigurationServiceInstance() { + } + + /** + * Get the name property: Name of the Application Configuration Service instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the Application Configuration Service instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProperties.java new file mode 100644 index 0000000000000..a0fd1f1244eb9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application Configuration Service properties payload. */ +@Fluent +public final class ConfigurationServiceProperties { + /* + * State of the Application Configuration Service. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ConfigurationServiceProvisioningState provisioningState; + + /* + * The generation of the Application Configuration Service. + */ + @JsonProperty(value = "generation") + private ConfigurationServiceGeneration generation; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests", access = JsonProperty.Access.WRITE_ONLY) + private ConfigurationServiceResourceRequests resourceRequests; + + /* + * Collection of instances belong to Application Configuration Service. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /* + * The settings of Application Configuration Service. + */ + @JsonProperty(value = "settings") + private ConfigurationServiceSettings settings; + + /** Creates an instance of ConfigurationServiceProperties class. */ + public ConfigurationServiceProperties() { + } + + /** + * Get the provisioningState property: State of the Application Configuration Service. + * + * @return the provisioningState value. + */ + public ConfigurationServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the generation property: The generation of the Application Configuration Service. + * + * @return the generation value. + */ + public ConfigurationServiceGeneration generation() { + return this.generation; + } + + /** + * Set the generation property: The generation of the Application Configuration Service. + * + * @param generation the generation value to set. + * @return the ConfigurationServiceProperties object itself. + */ + public ConfigurationServiceProperties withGeneration(ConfigurationServiceGeneration generation) { + this.generation = generation; + return this; + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public ConfigurationServiceResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Get the instances property: Collection of instances belong to Application Configuration Service. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Get the settings property: The settings of Application Configuration Service. + * + * @return the settings value. + */ + public ConfigurationServiceSettings settings() { + return this.settings; + } + + /** + * Set the settings property: The settings of Application Configuration Service. + * + * @param settings the settings value to set. + * @return the ConfigurationServiceProperties object itself. + */ + public ConfigurationServiceProperties withSettings(ConfigurationServiceSettings settings) { + this.settings = settings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + if (settings() != null) { + settings().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProvisioningState.java new file mode 100644 index 0000000000000..e8846c83f4527 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Application Configuration Service. */ +public final class ConfigurationServiceProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for ConfigurationServiceProvisioningState. */ + public static final ConfigurationServiceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ConfigurationServiceProvisioningState. */ + public static final ConfigurationServiceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ConfigurationServiceProvisioningState. */ + public static final ConfigurationServiceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ConfigurationServiceProvisioningState. */ + public static final ConfigurationServiceProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ConfigurationServiceProvisioningState. */ + public static final ConfigurationServiceProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ConfigurationServiceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationServiceProvisioningState() { + } + + /** + * Creates or finds a ConfigurationServiceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationServiceProvisioningState. + */ + @JsonCreator + public static ConfigurationServiceProvisioningState fromString(String name) { + return fromString(name, ConfigurationServiceProvisioningState.class); + } + + /** + * Gets known ConfigurationServiceProvisioningState values. + * + * @return known ConfigurationServiceProvisioningState values. + */ + public static Collection values() { + return values(ConfigurationServiceProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResource.java new file mode 100644 index 0000000000000..5deaae8d8b515 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResource.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; + +/** An immutable client-side representation of ConfigurationServiceResource. */ +public interface ConfigurationServiceResource { + /** + * 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 properties property: Application Configuration Service properties payload. + * + * @return the properties value. + */ + ConfigurationServiceProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner + * object. + * + * @return the inner object. + */ + ConfigurationServiceResourceInner innerModel(); + + /** The entirety of the ConfigurationServiceResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ConfigurationServiceResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ConfigurationServiceResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ConfigurationServiceResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the ConfigurationServiceResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConfigurationServiceResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConfigurationServiceResource create(Context context); + } + + /** The stage of the ConfigurationServiceResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Application Configuration Service properties payload. + * + * @param properties Application Configuration Service properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(ConfigurationServiceProperties properties); + } + } + + /** + * Begins update for the ConfigurationServiceResource resource. + * + * @return the stage of resource update. + */ + ConfigurationServiceResource.Update update(); + + /** The template for ConfigurationServiceResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConfigurationServiceResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConfigurationServiceResource apply(Context context); + } + + /** The ConfigurationServiceResource update stages. */ + interface UpdateStages { + /** The stage of the ConfigurationServiceResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Application Configuration Service properties payload. + * + * @param properties Application Configuration Service properties payload. + * @return the next definition stage. + */ + Update withProperties(ConfigurationServiceProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConfigurationServiceResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConfigurationServiceResource refresh(Context context); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validate(ConfigurationServiceSettings settings); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param settings Application Configuration Service settings to be validated. + * @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 validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validate(ConfigurationServiceSettings settings, Context context); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validateResource( + ConfigurationServiceResourceInner configurationServiceResource); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @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 validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validateResource( + ConfigurationServiceResourceInner configurationServiceResource, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResourceCollection.java new file mode 100644 index 0000000000000..9b5f784c4972d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of configuration service resources and a possible link for next set. */ +@Fluent +public final class ConfigurationServiceResourceCollection { + /* + * Collection of configuration service resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ConfigurationServiceResourceCollection class. */ + public ConfigurationServiceResourceCollection() { + } + + /** + * Get the value property: Collection of configuration service resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of configuration service resources. + * + * @param value the value value to set. + * @return the ConfigurationServiceResourceCollection object itself. + */ + public ConfigurationServiceResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ConfigurationServiceResourceCollection object itself. + */ + public ConfigurationServiceResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResourceRequests.java new file mode 100644 index 0000000000000..990a7cc24553f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResourceRequests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Application Configuration Service. */ +@Immutable +public final class ConfigurationServiceResourceRequests { + /* + * Cpu allocated to each Application Configuration Service instance + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory allocated to each Application Configuration Service instance + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /* + * Instance count of the Application Configuration Service + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** Creates an instance of ConfigurationServiceResourceRequests class. */ + public ConfigurationServiceResourceRequests() { + } + + /** + * Get the cpu property: Cpu allocated to each Application Configuration Service instance. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory allocated to each Application Configuration Service instance. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Get the instanceCount property: Instance count of the Application Configuration Service. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceSettings.java new file mode 100644 index 0000000000000..2166b18a8ea6a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceSettings.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The settings of Application Configuration Service. */ +@Fluent +public final class ConfigurationServiceSettings { + /* + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigurationServiceGitProperty gitProperty; + + /** Creates an instance of ConfigurationServiceSettings class. */ + public ConfigurationServiceSettings() { + } + + /** + * Get the gitProperty property: Property of git environment. + * + * @return the gitProperty value. + */ + public ConfigurationServiceGitProperty gitProperty() { + return this.gitProperty; + } + + /** + * Set the gitProperty property: Property of git environment. + * + * @param gitProperty the gitProperty value to set. + * @return the ConfigurationServiceSettings object itself. + */ + public ConfigurationServiceSettings withGitProperty(ConfigurationServiceGitProperty gitProperty) { + this.gitProperty = gitProperty; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitProperty() != null) { + gitProperty().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceSettingsValidateResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceSettingsValidateResult.java new file mode 100644 index 0000000000000..0050aeeda2d70 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceSettingsValidateResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceSettingsValidateResultInner; + +/** An immutable client-side representation of ConfigurationServiceSettingsValidateResult. */ +public interface ConfigurationServiceSettingsValidateResult { + /** + * Gets the gitPropertyValidationResult property: Validation result for configuration service settings. + * + * @return the gitPropertyValidationResult value. + */ + ConfigurationServiceGitPropertyValidateResult gitPropertyValidationResult(); + + /** + * Gets the inner + * com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceSettingsValidateResultInner + * object. + * + * @return the inner object. + */ + ConfigurationServiceSettingsValidateResultInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServices.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServices.java new file mode 100644 index 0000000000000..d88717f2d7d09 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServices.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; + +/** Resource collection API of ConfigurationServices. */ +public interface ConfigurationServices { + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @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 Application Configuration Service and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String configurationServiceName, Context context); + + /** + * Get the Application Configuration Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Configuration Service and its properties. + */ + ConfigurationServiceResource get(String resourceGroupName, String serviceName, String configurationServiceName); + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String configurationServiceName); + + /** + * Disable the default Application Configuration Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @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 serviceName, String configurationServiceName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of configuration service resources and a possible link for next set as + * paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings); + + /** + * Check if the Application Configuration Service settings are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param settings Application Configuration Service settings to be validated. + * @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 validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource); + + /** + * Check if the Application Configuration Service resource is valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param configurationServiceName The name of Application Configuration Service. + * @param configurationServiceResource Application Configuration Service resource to be validated. + * @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 validation result for configuration service settings. + */ + ConfigurationServiceSettingsValidateResult validateResource( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context); + + /** + * Get the Application Configuration Service and its properties. + * + * @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 Application Configuration Service and its properties along with {@link Response}. + */ + ConfigurationServiceResource getById(String id); + + /** + * Get the Application Configuration Service and its properties. + * + * @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 Application Configuration Service and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Disable the default Application Configuration Service. + * + * @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); + + /** + * Disable the default Application Configuration Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConfigurationServiceResource resource. + * + * @param name resource name. + * @return the first stage of the new ConfigurationServiceResource definition. + */ + ConfigurationServiceResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerProbeSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerProbeSettings.java new file mode 100644 index 0000000000000..049ee58dbc3f0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerProbeSettings.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container liveness and readiness probe settings. */ +@Fluent +public final class ContainerProbeSettings { + /* + * Indicates whether disable the liveness and readiness probe + */ + @JsonProperty(value = "disableProbe") + private Boolean disableProbe; + + /** Creates an instance of ContainerProbeSettings class. */ + public ContainerProbeSettings() { + } + + /** + * Get the disableProbe property: Indicates whether disable the liveness and readiness probe. + * + * @return the disableProbe value. + */ + public Boolean disableProbe() { + return this.disableProbe; + } + + /** + * Set the disableProbe property: Indicates whether disable the liveness and readiness probe. + * + * @param disableProbe the disableProbe value to set. + * @return the ContainerProbeSettings object itself. + */ + public ContainerProbeSettings withDisableProbe(Boolean disableProbe) { + this.disableProbe = disableProbe; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistries.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistries.java new file mode 100644 index 0000000000000..f569cab80898a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistries.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ContainerRegistries. */ +public interface ContainerRegistries { + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of container registry resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @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 container registries resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String containerRegistryName, Context context); + + /** + * Get the container registries resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container registries resource. + */ + ContainerRegistryResource get(String resourceGroupName, String serviceName, String containerRegistryName); + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String containerRegistryName); + + /** + * Delete a container registry resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @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 serviceName, String containerRegistryName, Context context); + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate 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 validation result for container registry properties. + */ + ContainerRegistryValidateResult validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties); + + /** + * Check if the container registry properties are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param containerRegistryName The name of the container registry. + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties. + */ + ContainerRegistryValidateResult validate( + String resourceGroupName, + String serviceName, + String containerRegistryName, + ContainerRegistryProperties containerRegistryProperties, + Context context); + + /** + * Get the container registries resource. + * + * @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 container registries resource along with {@link Response}. + */ + ContainerRegistryResource getById(String id); + + /** + * Get the container registries resource. + * + * @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 container registries resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a container registry resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a container registry resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ContainerRegistryResource resource. + * + * @param name resource name. + * @return the first stage of the new ContainerRegistryResource definition. + */ + ContainerRegistryResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryBasicCredentials.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryBasicCredentials.java new file mode 100644 index 0000000000000..5572db75b6398 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryBasicCredentials.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The basic authentication properties for the container registry resource. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("BasicAuth") +@Fluent +public final class ContainerRegistryBasicCredentials extends ContainerRegistryCredentials { + /* + * The login server of the Container Registry. + */ + @JsonProperty(value = "server", required = true) + private String server; + + /* + * The username of the Container Registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /* + * The password of the Container Registry. + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of ContainerRegistryBasicCredentials class. */ + public ContainerRegistryBasicCredentials() { + } + + /** + * Get the server property: The login server of the Container Registry. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The login server of the Container Registry. + * + * @param server the server value to set. + * @return the ContainerRegistryBasicCredentials object itself. + */ + public ContainerRegistryBasicCredentials withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username property: The username of the Container Registry. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username of the Container Registry. + * + * @param username the username value to set. + * @return the ContainerRegistryBasicCredentials object itself. + */ + public ContainerRegistryBasicCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the Container Registry. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the Container Registry. + * + * @param password the password value to set. + * @return the ContainerRegistryBasicCredentials object itself. + */ + public ContainerRegistryBasicCredentials withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (server() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property server in model ContainerRegistryBasicCredentials")); + } + if (username() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property username in model ContainerRegistryBasicCredentials")); + } + if (password() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property password in model ContainerRegistryBasicCredentials")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistryBasicCredentials.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryCredentials.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryCredentials.java new file mode 100644 index 0000000000000..e16361e30ecf1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryCredentials.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The credential for the container registry resource. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = ContainerRegistryCredentials.class) +@JsonTypeName("ContainerRegistryCredentials") +@JsonSubTypes({@JsonSubTypes.Type(name = "BasicAuth", value = ContainerRegistryBasicCredentials.class)}) +@Immutable +public class ContainerRegistryCredentials { + /** Creates an instance of ContainerRegistryCredentials class. */ + public ContainerRegistryCredentials() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryProperties.java new file mode 100644 index 0000000000000..f693b5b1a6fed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container registry resource payload. */ +@Fluent +public final class ContainerRegistryProperties { + /* + * The credentials of the container registry resource. + */ + @JsonProperty(value = "credentials", required = true) + private ContainerRegistryCredentials credentials; + + /* + * State of the Container Registry. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerRegistryProvisioningState provisioningState; + + /** Creates an instance of ContainerRegistryProperties class. */ + public ContainerRegistryProperties() { + } + + /** + * Get the credentials property: The credentials of the container registry resource. + * + * @return the credentials value. + */ + public ContainerRegistryCredentials credentials() { + return this.credentials; + } + + /** + * Set the credentials property: The credentials of the container registry resource. + * + * @param credentials the credentials value to set. + * @return the ContainerRegistryProperties object itself. + */ + public ContainerRegistryProperties withCredentials(ContainerRegistryCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the provisioningState property: State of the Container Registry. + * + * @return the provisioningState value. + */ + public ContainerRegistryProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (credentials() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property credentials in model ContainerRegistryProperties")); + } else { + credentials().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerRegistryProperties.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryProvisioningState.java new file mode 100644 index 0000000000000..6f2fa417f0fd5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Container Registry. */ +public final class ContainerRegistryProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ContainerRegistryProvisioningState. */ + public static final ContainerRegistryProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ContainerRegistryProvisioningState. */ + public static final ContainerRegistryProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ContainerRegistryProvisioningState. */ + public static final ContainerRegistryProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ContainerRegistryProvisioningState. */ + public static final ContainerRegistryProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ContainerRegistryProvisioningState. */ + public static final ContainerRegistryProvisioningState DELETING = fromString("Deleting"); + + /** Static value Canceled for ContainerRegistryProvisioningState. */ + public static final ContainerRegistryProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ContainerRegistryProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerRegistryProvisioningState() { + } + + /** + * Creates or finds a ContainerRegistryProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerRegistryProvisioningState. + */ + @JsonCreator + public static ContainerRegistryProvisioningState fromString(String name) { + return fromString(name, ContainerRegistryProvisioningState.class); + } + + /** + * Gets known ContainerRegistryProvisioningState values. + * + * @return known ContainerRegistryProvisioningState values. + */ + public static Collection values() { + return values(ContainerRegistryProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryResource.java new file mode 100644 index 0000000000000..8acc99fe95c81 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryResource.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryResourceInner; + +/** An immutable client-side representation of ContainerRegistryResource. */ +public interface ContainerRegistryResource { + /** + * 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 properties property: Properties of the container registry resource payload. + * + * @return the properties value. + */ + ContainerRegistryProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryResourceInner + * object. + * + * @return the inner object. + */ + ContainerRegistryResourceInner innerModel(); + + /** The entirety of the ContainerRegistryResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The ContainerRegistryResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ContainerRegistryResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the ContainerRegistryResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the ContainerRegistryResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerRegistryResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerRegistryResource create(Context context); + } + + /** The stage of the ContainerRegistryResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the container registry resource payload.. + * + * @param properties Properties of the container registry resource payload. + * @return the next definition stage. + */ + WithCreate withProperties(ContainerRegistryProperties properties); + } + } + + /** + * Begins update for the ContainerRegistryResource resource. + * + * @return the stage of resource update. + */ + ContainerRegistryResource.Update update(); + + /** The template for ContainerRegistryResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerRegistryResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerRegistryResource apply(Context context); + } + + /** The ContainerRegistryResource update stages. */ + interface UpdateStages { + /** The stage of the ContainerRegistryResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the container registry resource payload.. + * + * @param properties Properties of the container registry resource payload. + * @return the next definition stage. + */ + Update withProperties(ContainerRegistryProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ContainerRegistryResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerRegistryResource refresh(Context context); + + /** + * Check if the container registry properties are valid. + * + * @param containerRegistryProperties Parameters for the validate 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 validation result for container registry properties. + */ + ContainerRegistryValidateResult validate(ContainerRegistryProperties containerRegistryProperties); + + /** + * Check if the container registry properties are valid. + * + * @param containerRegistryProperties Parameters for the validate operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for container registry properties. + */ + ContainerRegistryValidateResult validate(ContainerRegistryProperties containerRegistryProperties, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryResourceCollection.java new file mode 100644 index 0000000000000..51f070f686021 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryResourceCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection compose of container registry resources list and a possible link for next page. */ +@Fluent +public final class ContainerRegistryResourceCollection { + /* + * The container registry resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of storage list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ContainerRegistryResourceCollection class. */ + public ContainerRegistryResourceCollection() { + } + + /** + * Get the value property: The container registry resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The container registry resources list. + * + * @param value the value value to set. + * @return the ContainerRegistryResourceCollection object itself. + */ + public ContainerRegistryResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of storage list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of storage list. + * + * @param nextLink the nextLink value to set. + * @return the ContainerRegistryResourceCollection object itself. + */ + public ContainerRegistryResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryValidateResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryValidateResult.java new file mode 100644 index 0000000000000..06f230ba44cb8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContainerRegistryValidateResult.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryValidateResultInner; + +/** An immutable client-side representation of ContainerRegistryValidateResult. */ +public interface ContainerRegistryValidateResult { + /** + * Gets the isValid property: Indicate if the container registry properties are valid. + * + * @return the isValid value. + */ + Boolean isValid(); + + /** + * Gets the message property: Detailed validation messages. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ContainerRegistryValidateResultInner + * object. + * + * @return the inner object. + */ + ContainerRegistryValidateResultInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContentCertificateProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContentCertificateProperties.java new file mode 100644 index 0000000000000..34271b2b38e39 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ContentCertificateProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of certificate imported from key vault. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ContentCertificate") +@Fluent +public final class ContentCertificateProperties extends CertificateProperties { + /* + * The content of uploaded certificate. + */ + @JsonProperty(value = "content") + private String content; + + /** Creates an instance of ContentCertificateProperties class. */ + public ContentCertificateProperties() { + } + + /** + * Get the content property: The content of uploaded certificate. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The content of uploaded certificate. + * + * @param content the content value to set. + * @return the ContentCertificateProperties object itself. + */ + public ContentCertificateProperties withContent(String content) { + this.content = content; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainer.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainer.java new file mode 100644 index 0000000000000..bd7dca00f7337 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainer.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Custom container payload. */ +@Fluent +public final class CustomContainer { + /* + * The name of the registry that contains the container image + */ + @JsonProperty(value = "server") + private String server; + + /* + * Container image of the custom container. This should be in the form of : without the server + * name of the registry + */ + @JsonProperty(value = "containerImage") + private String containerImage; + + /* + * Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. + */ + @JsonProperty(value = "command") + private List command; + + /* + * Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + */ + @JsonProperty(value = "args") + private List args; + + /* + * Credential of the image registry + */ + @JsonProperty(value = "imageRegistryCredential") + private ImageRegistryCredential imageRegistryCredential; + + /* + * Language framework of the container image uploaded. Supported values: "springboot", "", null. + */ + @JsonProperty(value = "languageFramework") + private String languageFramework; + + /** Creates an instance of CustomContainer class. */ + public CustomContainer() { + } + + /** + * Get the server property: The name of the registry that contains the container image. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: The name of the registry that contains the container image. + * + * @param server the server value to set. + * @return the CustomContainer object itself. + */ + public CustomContainer withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the containerImage property: Container image of the custom container. This should be in the form of + * <repository>:<tag> without the server name of the registry. + * + * @return the containerImage value. + */ + public String containerImage() { + return this.containerImage; + } + + /** + * Set the containerImage property: Container image of the custom container. This should be in the form of + * <repository>:<tag> without the server name of the registry. + * + * @param containerImage the containerImage value to set. + * @return the CustomContainer object itself. + */ + public CustomContainer withContainerImage(String containerImage) { + this.containerImage = containerImage; + return this; + } + + /** + * Get the command property: Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if + * this is not provided. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if + * this is not provided. + * + * @param command the command value to set. + * @return the CustomContainer object itself. + */ + public CustomContainer withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the args property: Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + * + * @return the args value. + */ + public List args() { + return this.args; + } + + /** + * Set the args property: Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + * + * @param args the args value to set. + * @return the CustomContainer object itself. + */ + public CustomContainer withArgs(List args) { + this.args = args; + return this; + } + + /** + * Get the imageRegistryCredential property: Credential of the image registry. + * + * @return the imageRegistryCredential value. + */ + public ImageRegistryCredential imageRegistryCredential() { + return this.imageRegistryCredential; + } + + /** + * Set the imageRegistryCredential property: Credential of the image registry. + * + * @param imageRegistryCredential the imageRegistryCredential value to set. + * @return the CustomContainer object itself. + */ + public CustomContainer withImageRegistryCredential(ImageRegistryCredential imageRegistryCredential) { + this.imageRegistryCredential = imageRegistryCredential; + return this; + } + + /** + * Get the languageFramework property: Language framework of the container image uploaded. Supported values: + * "springboot", "", null. + * + * @return the languageFramework value. + */ + public String languageFramework() { + return this.languageFramework; + } + + /** + * Set the languageFramework property: Language framework of the container image uploaded. Supported values: + * "springboot", "", null. + * + * @param languageFramework the languageFramework value to set. + * @return the CustomContainer object itself. + */ + public CustomContainer withLanguageFramework(String languageFramework) { + this.languageFramework = languageFramework; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (imageRegistryCredential() != null) { + imageRegistryCredential().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainerUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainerUserSourceInfo.java new file mode 100644 index 0000000000000..89be9f17c16f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainerUserSourceInfo.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Custom container user source info. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Container") +@Fluent +public final class CustomContainerUserSourceInfo extends UserSourceInfo { + /* + * Custom container payload + */ + @JsonProperty(value = "customContainer") + private CustomContainer customContainer; + + /** Creates an instance of CustomContainerUserSourceInfo class. */ + public CustomContainerUserSourceInfo() { + } + + /** + * Get the customContainer property: Custom container payload. + * + * @return the customContainer value. + */ + public CustomContainer customContainer() { + return this.customContainer; + } + + /** + * Set the customContainer property: Custom container payload. + * + * @param customContainer the customContainer value to set. + * @return the CustomContainerUserSourceInfo object itself. + */ + public CustomContainerUserSourceInfo withCustomContainer(CustomContainer customContainer) { + this.customContainer = customContainer; + return this; + } + + /** {@inheritDoc} */ + @Override + public CustomContainerUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (customContainer() != null) { + customContainer().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainProperties.java new file mode 100644 index 0000000000000..12119fc082999 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain of app resource payload. */ +@Fluent +public final class CustomDomainProperties { + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /* + * The app name of domain. + */ + @JsonProperty(value = "appName", access = JsonProperty.Access.WRITE_ONLY) + private String appName; + + /* + * The bound certificate name of domain. + */ + @JsonProperty(value = "certName") + private String certName; + + /* + * Provisioning state of the Domain + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomDomainResourceProvisioningState provisioningState; + + /** Creates an instance of CustomDomainProperties class. */ + public CustomDomainProperties() { + } + + /** + * Get the thumbprint property: The thumbprint of bound certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of bound certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get the appName property: The app name of domain. + * + * @return the appName value. + */ + public String appName() { + return this.appName; + } + + /** + * Get the certName property: The bound certificate name of domain. + * + * @return the certName value. + */ + public String certName() { + return this.certName; + } + + /** + * Set the certName property: The bound certificate name of domain. + * + * @param certName the certName value to set. + * @return the CustomDomainProperties object itself. + */ + public CustomDomainProperties withCertName(String certName) { + this.certName = certName; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Domain. + * + * @return the provisioningState value. + */ + public CustomDomainResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResource.java new file mode 100644 index 0000000000000..5eb83e46d601d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner; + +/** An immutable client-side representation of CustomDomainResource. */ +public interface CustomDomainResource { + /** + * 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 properties property: Properties of the custom domain resource. + * + * @return the properties value. + */ + CustomDomainProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner object. + * + * @return the inner object. + */ + CustomDomainResourceInner innerModel(); + + /** The entirety of the CustomDomainResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The CustomDomainResource definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomDomainResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the CustomDomainResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, appName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @return the next definition stage. + */ + WithCreate withExistingApp(String resourceGroupName, String serviceName, String appName); + } + + /** + * The stage of the CustomDomainResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomDomainResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomDomainResource create(Context context); + } + + /** The stage of the CustomDomainResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the custom domain resource.. + * + * @param properties Properties of the custom domain resource. + * @return the next definition stage. + */ + WithCreate withProperties(CustomDomainProperties properties); + } + } + + /** + * Begins update for the CustomDomainResource resource. + * + * @return the stage of resource update. + */ + CustomDomainResource.Update update(); + + /** The template for CustomDomainResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CustomDomainResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CustomDomainResource apply(Context context); + } + + /** The CustomDomainResource update stages. */ + interface UpdateStages { + /** The stage of the CustomDomainResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the custom domain resource.. + * + * @param properties Properties of the custom domain resource. + * @return the next definition stage. + */ + Update withProperties(CustomDomainProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomDomainResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomDomainResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResourceCollection.java new file mode 100644 index 0000000000000..6cd6e44fc412b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResourceCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection compose of a custom domain resources list and a possible link for next page. */ +@Fluent +public final class CustomDomainResourceCollection { + /* + * The custom domain resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of custom domain list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CustomDomainResourceCollection class. */ + public CustomDomainResourceCollection() { + } + + /** + * Get the value property: The custom domain resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The custom domain resources list. + * + * @param value the value value to set. + * @return the CustomDomainResourceCollection object itself. + */ + public CustomDomainResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of custom domain list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of custom domain list. + * + * @param nextLink the nextLink value to set. + * @return the CustomDomainResourceCollection object itself. + */ + public CustomDomainResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResourceProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResourceProvisioningState.java new file mode 100644 index 0000000000000..ba33e4db2bbc9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResourceProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the Domain. */ +public final class CustomDomainResourceProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for CustomDomainResourceProvisioningState. */ + public static final CustomDomainResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for CustomDomainResourceProvisioningState. */ + public static final CustomDomainResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for CustomDomainResourceProvisioningState. */ + public static final CustomDomainResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CustomDomainResourceProvisioningState. */ + public static final CustomDomainResourceProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for CustomDomainResourceProvisioningState. */ + public static final CustomDomainResourceProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of CustomDomainResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomDomainResourceProvisioningState() { + } + + /** + * Creates or finds a CustomDomainResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomDomainResourceProvisioningState. + */ + @JsonCreator + public static CustomDomainResourceProvisioningState fromString(String name) { + return fromString(name, CustomDomainResourceProvisioningState.class); + } + + /** + * Gets known CustomDomainResourceProvisioningState values. + * + * @return known CustomDomainResourceProvisioningState values. + */ + public static Collection values() { + return values(CustomDomainResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidatePayload.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidatePayload.java new file mode 100644 index 0000000000000..b430702155e4a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidatePayload.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain validate payload. */ +@Fluent +public final class CustomDomainValidatePayload { + /* + * Name to be validated + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** Creates an instance of CustomDomainValidatePayload class. */ + public CustomDomainValidatePayload() { + } + + /** + * Get the name property: Name to be validated. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to be validated. + * + * @param name the name value to set. + * @return the CustomDomainValidatePayload object itself. + */ + public CustomDomainValidatePayload withName(String name) { + this.name = name; + 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 CustomDomainValidatePayload")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomDomainValidatePayload.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidateResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidateResult.java new file mode 100644 index 0000000000000..e3b22bda5ae87 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidateResult.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner; + +/** An immutable client-side representation of CustomDomainValidateResult. */ +public interface CustomDomainValidateResult { + /** + * Gets the isValid property: Indicates if domain name is valid. + * + * @return the isValid value. + */ + Boolean isValid(); + + /** + * Gets the message property: Message of why domain name is invalid. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainValidateResultInner + * object. + * + * @return the inner object. + */ + CustomDomainValidateResultInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomains.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomains.java new file mode 100644 index 0000000000000..32a6e9aa42466 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomains.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.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CustomDomains. */ +public interface CustomDomains { + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String domainName, Context context); + + /** + * Get the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom domain of one lifecycle application. + */ + CustomDomainResource get(String resourceGroupName, String serviceName, String appName, String domainName); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, String domainName); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param domainName The name of the custom domain resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, String domainName, Context context); + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String appName); + + /** + * List the custom domains of one lifecycle application. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of a custom domain resources list and a possible link for next page as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String appName, Context context); + + /** + * Get the custom domain of one lifecycle application. + * + * @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 custom domain of one lifecycle application along with {@link Response}. + */ + CustomDomainResource getById(String id); + + /** + * Get the custom domain of one lifecycle application. + * + * @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 custom domain of one lifecycle application along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the custom domain of one lifecycle application. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomDomainResource resource. + * + * @param name resource name. + * @return the first stage of the new CustomDomainResource definition. + */ + CustomDomainResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskProperties.java new file mode 100644 index 0000000000000..e936b5c6d0599 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Custom persistent disk resource payload. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = CustomPersistentDiskProperties.class) +@JsonTypeName("CustomPersistentDiskProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "AzureFileVolume", value = AzureFileVolume.class)}) +@Fluent +public class CustomPersistentDiskProperties { + /* + * The mount path of the persistent disk. + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /* + * Indicates whether the persistent disk is a readOnly one. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /* + * If set to true, it will create and mount a dedicated directory for every individual app instance. + */ + @JsonProperty(value = "enableSubPath") + private Boolean enableSubPath; + + /* + * These are the mount options for a persistent disk. + */ + @JsonProperty(value = "mountOptions") + private List mountOptions; + + /** Creates an instance of CustomPersistentDiskProperties class. */ + public CustomPersistentDiskProperties() { + } + + /** + * Get the mountPath property: The mount path of the persistent disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: The mount path of the persistent disk. + * + * @param mountPath the mountPath value to set. + * @return the CustomPersistentDiskProperties object itself. + */ + public CustomPersistentDiskProperties withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the readOnly property: Indicates whether the persistent disk is a readOnly one. + * + * @return the readOnly value. + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: Indicates whether the persistent disk is a readOnly one. + * + * @param readOnly the readOnly value to set. + * @return the CustomPersistentDiskProperties object itself. + */ + public CustomPersistentDiskProperties withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the enableSubPath property: If set to true, it will create and mount a dedicated directory for every + * individual app instance. + * + * @return the enableSubPath value. + */ + public Boolean enableSubPath() { + return this.enableSubPath; + } + + /** + * Set the enableSubPath property: If set to true, it will create and mount a dedicated directory for every + * individual app instance. + * + * @param enableSubPath the enableSubPath value to set. + * @return the CustomPersistentDiskProperties object itself. + */ + public CustomPersistentDiskProperties withEnableSubPath(Boolean enableSubPath) { + this.enableSubPath = enableSubPath; + return this; + } + + /** + * Get the mountOptions property: These are the mount options for a persistent disk. + * + * @return the mountOptions value. + */ + public List mountOptions() { + return this.mountOptions; + } + + /** + * Set the mountOptions property: These are the mount options for a persistent disk. + * + * @param mountOptions the mountOptions value to set. + * @return the CustomPersistentDiskProperties object itself. + */ + public CustomPersistentDiskProperties withMountOptions(List mountOptions) { + this.mountOptions = mountOptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mountPath() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property mountPath in model CustomPersistentDiskProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomPersistentDiskProperties.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskResource.java new file mode 100644 index 0000000000000..53fae811c6873 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskResource.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom persistent disk resource payload. */ +@Fluent +public final class CustomPersistentDiskResource { + /* + * Properties of the custom persistent disk resource payload. + */ + @JsonProperty(value = "customPersistentDiskProperties") + private CustomPersistentDiskProperties customPersistentDiskProperties; + + /* + * The resource id of Azure Spring Apps Storage resource. + */ + @JsonProperty(value = "storageId", required = true) + private String storageId; + + /** Creates an instance of CustomPersistentDiskResource class. */ + public CustomPersistentDiskResource() { + } + + /** + * Get the customPersistentDiskProperties property: Properties of the custom persistent disk resource payload. + * + * @return the customPersistentDiskProperties value. + */ + public CustomPersistentDiskProperties customPersistentDiskProperties() { + return this.customPersistentDiskProperties; + } + + /** + * Set the customPersistentDiskProperties property: Properties of the custom persistent disk resource payload. + * + * @param customPersistentDiskProperties the customPersistentDiskProperties value to set. + * @return the CustomPersistentDiskResource object itself. + */ + public CustomPersistentDiskResource withCustomPersistentDiskProperties( + CustomPersistentDiskProperties customPersistentDiskProperties) { + this.customPersistentDiskProperties = customPersistentDiskProperties; + return this; + } + + /** + * Get the storageId property: The resource id of Azure Spring Apps Storage resource. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: The resource id of Azure Spring Apps Storage resource. + * + * @param storageId the storageId value to set. + * @return the CustomPersistentDiskResource object itself. + */ + public CustomPersistentDiskResource withStorageId(String storageId) { + this.storageId = storageId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (customPersistentDiskProperties() != null) { + customPersistentDiskProperties().validate(); + } + if (storageId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property storageId in model CustomPersistentDiskResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomPersistentDiskResource.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomScaleRule.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomScaleRule.java new file mode 100644 index 0000000000000..c639bb57da430 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomScaleRule.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Spring Apps App Instance Custom scaling rule. */ +@Fluent +public final class CustomScaleRule { + /* + * Type of the custom scale rule + * eg: azure-servicebus, redis etc. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Metadata properties to describe custom scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the custom scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** Creates an instance of CustomScaleRule class. */ + public CustomScaleRule() { + } + + /** + * Get the type property: Type of the custom scale rule eg: azure-servicebus, redis etc. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the custom scale rule eg: azure-servicebus, redis etc. + * + * @param type the type value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withType(String type) { + this.type = type; + return this; + } + + /** + * Get the metadata property: Metadata properties to describe custom scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe custom scale rule. + * + * @param metadata the metadata value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the custom scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the custom scale rule. + * + * @param auth the auth value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorProperties.java new file mode 100644 index 0000000000000..5e7b139547edf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorProperties.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Customized accelerator properties payload. */ +@Fluent +public final class CustomizedAcceleratorProperties { + /* + * State of the customized accelerator. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CustomizedAcceleratorProvisioningState provisioningState; + + /* + * Type of the customized accelerator. + */ + @JsonProperty(value = "acceleratorType") + private CustomizedAcceleratorType acceleratorType; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * The description property. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The iconUrl property. + */ + @JsonProperty(value = "iconUrl") + private String iconUrl; + + /* + * The acceleratorTags property. + */ + @JsonProperty(value = "acceleratorTags") + private List acceleratorTags; + + /* + * Imports references all imports that this accelerator/fragment depends upon. + */ + @JsonProperty(value = "imports", access = JsonProperty.Access.WRITE_ONLY) + private List imports; + + /* + * The gitRepository property. + */ + @JsonProperty(value = "gitRepository", required = true) + private AcceleratorGitRepository gitRepository; + + /** Creates an instance of CustomizedAcceleratorProperties class. */ + public CustomizedAcceleratorProperties() { + } + + /** + * Get the provisioningState property: State of the customized accelerator. + * + * @return the provisioningState value. + */ + public CustomizedAcceleratorProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the acceleratorType property: Type of the customized accelerator. + * + * @return the acceleratorType value. + */ + public CustomizedAcceleratorType acceleratorType() { + return this.acceleratorType; + } + + /** + * Set the acceleratorType property: Type of the customized accelerator. + * + * @param acceleratorType the acceleratorType value to set. + * @return the CustomizedAcceleratorProperties object itself. + */ + public CustomizedAcceleratorProperties withAcceleratorType(CustomizedAcceleratorType acceleratorType) { + this.acceleratorType = acceleratorType; + return this; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The displayName property. + * + * @param displayName the displayName value to set. + * @return the CustomizedAcceleratorProperties object itself. + */ + public CustomizedAcceleratorProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description property. + * + * @param description the description value to set. + * @return the CustomizedAcceleratorProperties object itself. + */ + public CustomizedAcceleratorProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the iconUrl property: The iconUrl property. + * + * @return the iconUrl value. + */ + public String iconUrl() { + return this.iconUrl; + } + + /** + * Set the iconUrl property: The iconUrl property. + * + * @param iconUrl the iconUrl value to set. + * @return the CustomizedAcceleratorProperties object itself. + */ + public CustomizedAcceleratorProperties withIconUrl(String iconUrl) { + this.iconUrl = iconUrl; + return this; + } + + /** + * Get the acceleratorTags property: The acceleratorTags property. + * + * @return the acceleratorTags value. + */ + public List acceleratorTags() { + return this.acceleratorTags; + } + + /** + * Set the acceleratorTags property: The acceleratorTags property. + * + * @param acceleratorTags the acceleratorTags value to set. + * @return the CustomizedAcceleratorProperties object itself. + */ + public CustomizedAcceleratorProperties withAcceleratorTags(List acceleratorTags) { + this.acceleratorTags = acceleratorTags; + return this; + } + + /** + * Get the imports property: Imports references all imports that this accelerator/fragment depends upon. + * + * @return the imports value. + */ + public List imports() { + return this.imports; + } + + /** + * Get the gitRepository property: The gitRepository property. + * + * @return the gitRepository value. + */ + public AcceleratorGitRepository gitRepository() { + return this.gitRepository; + } + + /** + * Set the gitRepository property: The gitRepository property. + * + * @param gitRepository the gitRepository value to set. + * @return the CustomizedAcceleratorProperties object itself. + */ + public CustomizedAcceleratorProperties withGitRepository(AcceleratorGitRepository gitRepository) { + this.gitRepository = gitRepository; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (gitRepository() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property gitRepository in model CustomizedAcceleratorProperties")); + } else { + gitRepository().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CustomizedAcceleratorProperties.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorProvisioningState.java new file mode 100644 index 0000000000000..081e3bea49160 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the customized accelerator. */ +public final class CustomizedAcceleratorProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for CustomizedAcceleratorProvisioningState. */ + public static final CustomizedAcceleratorProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for CustomizedAcceleratorProvisioningState. */ + public static final CustomizedAcceleratorProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for CustomizedAcceleratorProvisioningState. */ + public static final CustomizedAcceleratorProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for CustomizedAcceleratorProvisioningState. */ + public static final CustomizedAcceleratorProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for CustomizedAcceleratorProvisioningState. */ + public static final CustomizedAcceleratorProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of CustomizedAcceleratorProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomizedAcceleratorProvisioningState() { + } + + /** + * Creates or finds a CustomizedAcceleratorProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomizedAcceleratorProvisioningState. + */ + @JsonCreator + public static CustomizedAcceleratorProvisioningState fromString(String name) { + return fromString(name, CustomizedAcceleratorProvisioningState.class); + } + + /** + * Gets known CustomizedAcceleratorProvisioningState values. + * + * @return known CustomizedAcceleratorProvisioningState values. + */ + public static Collection values() { + return values(CustomizedAcceleratorProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorResource.java new file mode 100644 index 0000000000000..b180804a69ef4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorResource.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.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner; + +/** An immutable client-side representation of CustomizedAcceleratorResource. */ +public interface CustomizedAcceleratorResource { + /** + * 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 properties property: Customized accelerator properties payload. + * + * @return the properties value. + */ + CustomizedAcceleratorProperties properties(); + + /** + * Gets the sku property: Sku of the customized accelerator 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner + * object. + * + * @return the inner object. + */ + CustomizedAcceleratorResourceInner innerModel(); + + /** The entirety of the CustomizedAcceleratorResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The CustomizedAcceleratorResource definition stages. */ + interface DefinitionStages { + /** The first stage of the CustomizedAcceleratorResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the CustomizedAcceleratorResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, applicationAcceleratorName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @return the next definition stage. + */ + WithCreate withExistingApplicationAccelerator( + String resourceGroupName, String serviceName, String applicationAcceleratorName); + } + + /** + * The stage of the CustomizedAcceleratorResource 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.WithProperties, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + CustomizedAcceleratorResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CustomizedAcceleratorResource create(Context context); + } + + /** The stage of the CustomizedAcceleratorResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Customized accelerator properties payload. + * + * @param properties Customized accelerator properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(CustomizedAcceleratorProperties properties); + } + + /** The stage of the CustomizedAcceleratorResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the customized accelerator resource. + * + * @param sku Sku of the customized accelerator resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the CustomizedAcceleratorResource resource. + * + * @return the stage of resource update. + */ + CustomizedAcceleratorResource.Update update(); + + /** The template for CustomizedAcceleratorResource update. */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CustomizedAcceleratorResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CustomizedAcceleratorResource apply(Context context); + } + + /** The CustomizedAcceleratorResource update stages. */ + interface UpdateStages { + /** The stage of the CustomizedAcceleratorResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Customized accelerator properties payload. + * + * @param properties Customized accelerator properties payload. + * @return the next definition stage. + */ + Update withProperties(CustomizedAcceleratorProperties properties); + } + + /** The stage of the CustomizedAcceleratorResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the customized accelerator resource. + * + * @param sku Sku of the customized accelerator resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CustomizedAcceleratorResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CustomizedAcceleratorResource refresh(Context context); + + /** + * Check the customized accelerator are valid. + * + * @param properties Customized accelerator properties to be validated. + * @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 validation result for customized accelerator properties along with {@link Response}. + */ + Response validateWithResponse( + CustomizedAcceleratorProperties properties, Context context); + + /** + * Check the customized accelerator are valid. + * + * @param properties Customized accelerator properties to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties. + */ + CustomizedAcceleratorValidateResult validate(CustomizedAcceleratorProperties properties); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorResourceCollection.java new file mode 100644 index 0000000000000..289fafd44ceec --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorResourceCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The CustomizedAcceleratorResourceCollection model. */ +@Fluent +public final class CustomizedAcceleratorResourceCollection { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of CustomizedAcceleratorResourceCollection class. */ + public CustomizedAcceleratorResourceCollection() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the CustomizedAcceleratorResourceCollection object itself. + */ + public CustomizedAcceleratorResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the CustomizedAcceleratorResourceCollection object itself. + */ + public CustomizedAcceleratorResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorType.java new file mode 100644 index 0000000000000..febf82bf3d79e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the customized accelerator. */ +public final class CustomizedAcceleratorType extends ExpandableStringEnum { + /** Static value Accelerator for CustomizedAcceleratorType. */ + public static final CustomizedAcceleratorType ACCELERATOR = fromString("Accelerator"); + + /** Static value Fragment for CustomizedAcceleratorType. */ + public static final CustomizedAcceleratorType FRAGMENT = fromString("Fragment"); + + /** + * Creates a new instance of CustomizedAcceleratorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomizedAcceleratorType() { + } + + /** + * Creates or finds a CustomizedAcceleratorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomizedAcceleratorType. + */ + @JsonCreator + public static CustomizedAcceleratorType fromString(String name) { + return fromString(name, CustomizedAcceleratorType.class); + } + + /** + * Gets known CustomizedAcceleratorType values. + * + * @return known CustomizedAcceleratorType values. + */ + public static Collection values() { + return values(CustomizedAcceleratorType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorValidateResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorValidateResult.java new file mode 100644 index 0000000000000..3258cff6b3703 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorValidateResult.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorValidateResultInner; + +/** An immutable client-side representation of CustomizedAcceleratorValidateResult. */ +public interface CustomizedAcceleratorValidateResult { + /** + * Gets the state property: State of the customized accelerator validation result. + * + * @return the state value. + */ + CustomizedAcceleratorValidateResultState state(); + + /** + * Gets the errorMessage property: The detail validation results. + * + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * Gets the inner + * com.azure.resourcemanager.appplatform.generated.fluent.models.CustomizedAcceleratorValidateResultInner object. + * + * @return the inner object. + */ + CustomizedAcceleratorValidateResultInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorValidateResultState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorValidateResultState.java new file mode 100644 index 0000000000000..3065c2294b36a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAcceleratorValidateResultState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the customized accelerator validation result. */ +public final class CustomizedAcceleratorValidateResultState + extends ExpandableStringEnum { + /** Static value Valid for CustomizedAcceleratorValidateResultState. */ + public static final CustomizedAcceleratorValidateResultState VALID = fromString("Valid"); + + /** Static value Invalid for CustomizedAcceleratorValidateResultState. */ + public static final CustomizedAcceleratorValidateResultState INVALID = fromString("Invalid"); + + /** + * Creates a new instance of CustomizedAcceleratorValidateResultState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CustomizedAcceleratorValidateResultState() { + } + + /** + * Creates or finds a CustomizedAcceleratorValidateResultState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomizedAcceleratorValidateResultState. + */ + @JsonCreator + public static CustomizedAcceleratorValidateResultState fromString(String name) { + return fromString(name, CustomizedAcceleratorValidateResultState.class); + } + + /** + * Gets known CustomizedAcceleratorValidateResultState values. + * + * @return known CustomizedAcceleratorValidateResultState values. + */ + public static Collection values() { + return values(CustomizedAcceleratorValidateResultState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAccelerators.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAccelerators.java new file mode 100644 index 0000000000000..6913429f656f0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomizedAccelerators.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of CustomizedAccelerators. */ +public interface CustomizedAccelerators { + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName); + + /** + * Handle requests to list all customized accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @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 customized accelerator along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context); + + /** + * Get the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the customized accelerator. + */ + CustomizedAcceleratorResource get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName); + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName); + + /** + * Delete the customized accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @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 serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + Context context); + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @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 validation result for customized accelerator properties along with {@link Response}. + */ + Response validateWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties, + Context context); + + /** + * Check the customized accelerator are valid. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param customizedAcceleratorName The name of the customized accelerator. + * @param properties Customized accelerator properties to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for customized accelerator properties. + */ + CustomizedAcceleratorValidateResult validate( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String customizedAcceleratorName, + CustomizedAcceleratorProperties properties); + + /** + * Get the customized accelerator. + * + * @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 customized accelerator along with {@link Response}. + */ + CustomizedAcceleratorResource getById(String id); + + /** + * Get the customized accelerator. + * + * @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 customized accelerator along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the customized accelerator. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the customized accelerator. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CustomizedAcceleratorResource resource. + * + * @param name resource name. + * @return the first stage of the new CustomizedAcceleratorResource definition. + */ + CustomizedAcceleratorResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentInstance.java new file mode 100644 index 0000000000000..65bf8e9e1d01a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentInstance.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment instance payload. */ +@Immutable +public final class DeploymentInstance { + /* + * Name of the deployment instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the deployment instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Failed reason of the deployment instance + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /* + * Discovery status of the deployment instance + */ + @JsonProperty(value = "discoveryStatus", access = JsonProperty.Access.WRITE_ONLY) + private String discoveryStatus; + + /* + * Start time of the deployment instance + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private String startTime; + + /* + * Availability zone information of the deployment instance + */ + @JsonProperty(value = "zone", access = JsonProperty.Access.WRITE_ONLY) + private String zone; + + /** Creates an instance of DeploymentInstance class. */ + public DeploymentInstance() { + } + + /** + * Get the name property: Name of the deployment instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the deployment instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the reason property: Failed reason of the deployment instance. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the discoveryStatus property: Discovery status of the deployment instance. + * + * @return the discoveryStatus value. + */ + public String discoveryStatus() { + return this.discoveryStatus; + } + + /** + * Get the startTime property: Start time of the deployment instance. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Get the zone property: Availability zone information of the deployment instance. + * + * @return the zone value. + */ + public String zone() { + return this.zone; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentList.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentList.java new file mode 100644 index 0000000000000..cbd8435f39c14 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentList.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentListInner; +import java.util.List; + +/** An immutable client-side representation of DeploymentList. */ +public interface DeploymentList { + /** + * Gets the deployments property: A list of deployment resource ids. + * + * @return the deployments value. + */ + List deployments(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentListInner object. + * + * @return the inner object. + */ + DeploymentListInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResource.java new file mode 100644 index 0000000000000..50ac41f898c06 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResource.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner; + +/** An immutable client-side representation of DeploymentResource. */ +public interface DeploymentResource { + /** + * 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 properties property: Properties of the Deployment resource. + * + * @return the properties value. + */ + DeploymentResourceProperties properties(); + + /** + * Gets the sku property: Sku of the Deployment 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner object. + * + * @return the inner object. + */ + DeploymentResourceInner innerModel(); + + /** The entirety of the DeploymentResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The DeploymentResource definition stages. */ + interface DefinitionStages { + /** The first stage of the DeploymentResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the DeploymentResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, appName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @return the next definition stage. + */ + WithCreate withExistingApp(String resourceGroupName, String serviceName, String appName); + } + + /** + * The stage of the DeploymentResource 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.WithProperties, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + DeploymentResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DeploymentResource create(Context context); + } + + /** The stage of the DeploymentResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the Deployment resource. + * + * @param properties Properties of the Deployment resource. + * @return the next definition stage. + */ + WithCreate withProperties(DeploymentResourceProperties properties); + } + + /** The stage of the DeploymentResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the Deployment resource. + * + * @param sku Sku of the Deployment resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the DeploymentResource resource. + * + * @return the stage of resource update. + */ + DeploymentResource.Update update(); + + /** The template for DeploymentResource update. */ + interface Update extends UpdateStages.WithProperties, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DeploymentResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DeploymentResource apply(Context context); + } + + /** The DeploymentResource update stages. */ + interface UpdateStages { + /** The stage of the DeploymentResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the Deployment resource. + * + * @param properties Properties of the Deployment resource. + * @return the next definition stage. + */ + Update withProperties(DeploymentResourceProperties properties); + } + + /** The stage of the DeploymentResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the Deployment resource. + * + * @param sku Sku of the Deployment resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DeploymentResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DeploymentResource refresh(Context context); + + /** + * Start the deployment. + * + * @throws com.azure.core.management.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 start(); + + /** + * Start the deployment. + * + * @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 start(Context context); + + /** + * Stop the deployment. + * + * @throws com.azure.core.management.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 stop(); + + /** + * Stop the deployment. + * + * @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 stop(Context context); + + /** + * Restart the deployment. + * + * @throws com.azure.core.management.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 restart(); + + /** + * Restart the deployment. + * + * @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 restart(Context context); + + /** + * Enable remote debugging. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging enableRemoteDebugging(); + + /** + * Enable remote debugging. + * + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @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 remote debugging config. + */ + RemoteDebugging enableRemoteDebugging(RemoteDebuggingPayload remoteDebuggingPayload, Context context); + + /** + * Disable remote debugging. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging disableRemoteDebugging(); + + /** + * Disable remote debugging. + * + * @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 remote debugging config. + */ + RemoteDebugging disableRemoteDebugging(Context context); + + /** + * Get remote debugging config. + * + * @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 remote debugging config along with {@link Response}. + */ + Response getRemoteDebuggingConfigWithResponse(Context context); + + /** + * Get remote debugging config. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging getRemoteDebuggingConfig(); + + /** + * Get deployment log file URL. + * + * @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 deployment log file URL along with {@link Response}. + */ + Response getLogFileUrlWithResponse(Context context); + + /** + * Get deployment log file URL. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + LogFileUrlResponse getLogFileUrl(); + + /** + * Generate Heap Dump. + * + * @param diagnosticParameters Parameters for the diagnostic 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 generateHeapDump(DiagnosticParameters diagnosticParameters); + + /** + * Generate Heap Dump. + * + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generateHeapDump(DiagnosticParameters diagnosticParameters, Context context); + + /** + * Generate Thread Dump. + * + * @param diagnosticParameters Parameters for the diagnostic 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 generateThreadDump(DiagnosticParameters diagnosticParameters); + + /** + * Generate Thread Dump. + * + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generateThreadDump(DiagnosticParameters diagnosticParameters, Context context); + + /** + * Start JFR. + * + * @param diagnosticParameters Parameters for the diagnostic 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 startJfr(DiagnosticParameters diagnosticParameters); + + /** + * Start JFR. + * + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startJfr(DiagnosticParameters diagnosticParameters, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceCollection.java new file mode 100644 index 0000000000000..3c72c7a477f30 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of App resources and a possible link for next set. */ +@Fluent +public final class DeploymentResourceCollection { + /* + * Collection of Deployment resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of DeploymentResourceCollection class. */ + public DeploymentResourceCollection() { + } + + /** + * Get the value property: Collection of Deployment resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Deployment resources. + * + * @param value the value value to set. + * @return the DeploymentResourceCollection object itself. + */ + public DeploymentResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the DeploymentResourceCollection object itself. + */ + public DeploymentResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProperties.java new file mode 100644 index 0000000000000..eff4a1920482f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Deployment resource properties payload. */ +@Fluent +public final class DeploymentResourceProperties { + /* + * Uploaded source information of the deployment. + */ + @JsonProperty(value = "source") + private UserSourceInfo source; + + /* + * Deployment settings of the Deployment + */ + @JsonProperty(value = "deploymentSettings") + private DeploymentSettings deploymentSettings; + + /* + * Provisioning state of the Deployment + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceProvisioningState provisioningState; + + /* + * Status of the Deployment + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private DeploymentResourceStatus status; + + /* + * Indicates whether the Deployment is active + */ + @JsonProperty(value = "active") + private Boolean active; + + /* + * Collection of instances belong to the Deployment + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of DeploymentResourceProperties class. */ + public DeploymentResourceProperties() { + } + + /** + * Get the source property: Uploaded source information of the deployment. + * + * @return the source value. + */ + public UserSourceInfo source() { + return this.source; + } + + /** + * Set the source property: Uploaded source information of the deployment. + * + * @param source the source value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withSource(UserSourceInfo source) { + this.source = source; + return this; + } + + /** + * Get the deploymentSettings property: Deployment settings of the Deployment. + * + * @return the deploymentSettings value. + */ + public DeploymentSettings deploymentSettings() { + return this.deploymentSettings; + } + + /** + * Set the deploymentSettings property: Deployment settings of the Deployment. + * + * @param deploymentSettings the deploymentSettings value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withDeploymentSettings(DeploymentSettings deploymentSettings) { + this.deploymentSettings = deploymentSettings; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Deployment. + * + * @return the provisioningState value. + */ + public DeploymentResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status property: Status of the Deployment. + * + * @return the status value. + */ + public DeploymentResourceStatus status() { + return this.status; + } + + /** + * Get the active property: Indicates whether the Deployment is active. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Set the active property: Indicates whether the Deployment is active. + * + * @param active the active value to set. + * @return the DeploymentResourceProperties object itself. + */ + public DeploymentResourceProperties withActive(Boolean active) { + this.active = active; + return this; + } + + /** + * Get the instances property: Collection of instances belong to the Deployment. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() != null) { + source().validate(); + } + if (deploymentSettings() != null) { + deploymentSettings().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProvisioningState.java new file mode 100644 index 0000000000000..5aec46eba9d17 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the Deployment. */ +public final class DeploymentResourceProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DeploymentResourceProvisioningState. */ + public static final DeploymentResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of DeploymentResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentResourceProvisioningState() { + } + + /** + * Creates or finds a DeploymentResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResourceProvisioningState. + */ + @JsonCreator + public static DeploymentResourceProvisioningState fromString(String name) { + return fromString(name, DeploymentResourceProvisioningState.class); + } + + /** + * Gets known DeploymentResourceProvisioningState values. + * + * @return known DeploymentResourceProvisioningState values. + */ + public static Collection values() { + return values(DeploymentResourceProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceStatus.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceStatus.java new file mode 100644 index 0000000000000..2e2a683b97be6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceStatus.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the Deployment. */ +public final class DeploymentResourceStatus extends ExpandableStringEnum { + /** Static value Stopped for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus STOPPED = fromString("Stopped"); + + /** Static value Running for DeploymentResourceStatus. */ + public static final DeploymentResourceStatus RUNNING = fromString("Running"); + + /** + * Creates a new instance of DeploymentResourceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentResourceStatus() { + } + + /** + * Creates or finds a DeploymentResourceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentResourceStatus. + */ + @JsonCreator + public static DeploymentResourceStatus fromString(String name) { + return fromString(name, DeploymentResourceStatus.class); + } + + /** + * Gets known DeploymentResourceStatus values. + * + * @return known DeploymentResourceStatus values. + */ + public static Collection values() { + return values(DeploymentResourceStatus.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentSettings.java new file mode 100644 index 0000000000000..d6137b5c67312 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentSettings.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Deployment settings payload. */ +@Fluent +public final class DeploymentSettings { + /* + * The requested resource quantity for required CPU and Memory. It is recommended that using this field to + * represent the required CPU and Memory, the old field cpu and memoryInGB will be deprecated later. + */ + @JsonProperty(value = "resourceRequests") + private ResourceRequests resourceRequests; + + /* + * Collection of environment variables + */ + @JsonProperty(value = "environmentVariables") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map environmentVariables; + + /* + * Collection of ApmReferences + */ + @JsonProperty(value = "apms") + private List apms; + + /* + * Collection of addons + */ + @JsonProperty(value = "addonConfigs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> addonConfigs; + + /* + * Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ + @JsonProperty(value = "livenessProbe") + private Probe livenessProbe; + + /* + * Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the + * probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ + @JsonProperty(value = "readinessProbe") + private Probe readinessProbe; + + /* + * StartupProbe indicates that the App Instance has successfully initialized. If specified, no other probes are + * executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the + * livenessProbe failed. This can be used to provide different probe parameters at the beginning of a App + * Instance's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state + * operation. This cannot be updated. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ + @JsonProperty(value = "startupProbe") + private Probe startupProbe; + + /* + * Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. + * Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no + * opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period + * is the duration in seconds after the processes running in the App Instance are sent a termination signal and the + * time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup + * time for your process. Defaults to 90 seconds. + */ + @JsonProperty(value = "terminationGracePeriodSeconds") + private Integer terminationGracePeriodSeconds; + + /* + * Scaling properties for the Azure Spring Apps App Instance. + */ + @JsonProperty(value = "scale") + private Scale scale; + + /* + * Container liveness and readiness probe settings + */ + @JsonProperty(value = "containerProbeSettings") + private ContainerProbeSettings containerProbeSettings; + + /** Creates an instance of DeploymentSettings class. */ + public DeploymentSettings() { + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. It is recommended + * that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be + * deprecated later. + * + * @return the resourceRequests value. + */ + public ResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Set the resourceRequests property: The requested resource quantity for required CPU and Memory. It is recommended + * that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be + * deprecated later. + * + * @param resourceRequests the resourceRequests value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withResourceRequests(ResourceRequests resourceRequests) { + this.resourceRequests = resourceRequests; + return this; + } + + /** + * Get the environmentVariables property: Collection of environment variables. + * + * @return the environmentVariables value. + */ + public Map environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Collection of environment variables. + * + * @param environmentVariables the environmentVariables value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withEnvironmentVariables(Map environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the apms property: Collection of ApmReferences. + * + * @return the apms value. + */ + public List apms() { + return this.apms; + } + + /** + * Set the apms property: Collection of ApmReferences. + * + * @param apms the apms value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withApms(List apms) { + this.apms = apms; + return this; + } + + /** + * Get the addonConfigs property: Collection of addons. + * + * @return the addonConfigs value. + */ + public Map> addonConfigs() { + return this.addonConfigs; + } + + /** + * Set the addonConfigs property: Collection of addons. + * + * @param addonConfigs the addonConfigs value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withAddonConfigs(Map> addonConfigs) { + this.addonConfigs = addonConfigs; + return this; + } + + /** + * Get the livenessProbe property: Periodic probe of App Instance liveness. App Instance will be restarted if the + * probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @return the livenessProbe value. + */ + public Probe livenessProbe() { + return this.livenessProbe; + } + + /** + * Set the livenessProbe property: Periodic probe of App Instance liveness. App Instance will be restarted if the + * probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @param livenessProbe the livenessProbe value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withLivenessProbe(Probe livenessProbe) { + this.livenessProbe = livenessProbe; + return this; + } + + /** + * Get the readinessProbe property: Periodic probe of App Instance service readiness. App Instance will be removed + * from service endpoints if the probe fails. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @return the readinessProbe value. + */ + public Probe readinessProbe() { + return this.readinessProbe; + } + + /** + * Set the readinessProbe property: Periodic probe of App Instance service readiness. App Instance will be removed + * from service endpoints if the probe fails. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @param readinessProbe the readinessProbe value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withReadinessProbe(Probe readinessProbe) { + this.readinessProbe = readinessProbe; + return this; + } + + /** + * Get the startupProbe property: StartupProbe indicates that the App Instance has successfully initialized. If + * specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be + * restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the + * beginning of a App Instance's lifecycle, when it might take a long time to load data or warm a cache, than during + * steady-state operation. This cannot be updated. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @return the startupProbe value. + */ + public Probe startupProbe() { + return this.startupProbe; + } + + /** + * Set the startupProbe property: StartupProbe indicates that the App Instance has successfully initialized. If + * specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be + * restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the + * beginning of a App Instance's lifecycle, when it might take a long time to load data or warm a cache, than during + * steady-state operation. This cannot be updated. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @param startupProbe the startupProbe value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withStartupProbe(Probe startupProbe) { + this.startupProbe = startupProbe; + return this; + } + + /** + * Get the terminationGracePeriodSeconds property: Optional duration in seconds the App Instance needs to terminate + * gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop + * immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period + * will be used instead. The grace period is the duration in seconds after the processes running in the App Instance + * are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + * value longer than the expected cleanup time for your process. Defaults to 90 seconds. + * + * @return the terminationGracePeriodSeconds value. + */ + public Integer terminationGracePeriodSeconds() { + return this.terminationGracePeriodSeconds; + } + + /** + * Set the terminationGracePeriodSeconds property: Optional duration in seconds the App Instance needs to terminate + * gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop + * immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period + * will be used instead. The grace period is the duration in seconds after the processes running in the App Instance + * are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + * value longer than the expected cleanup time for your process. Defaults to 90 seconds. + * + * @param terminationGracePeriodSeconds the terminationGracePeriodSeconds value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withTerminationGracePeriodSeconds(Integer terminationGracePeriodSeconds) { + this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; + return this; + } + + /** + * Get the scale property: Scaling properties for the Azure Spring Apps App Instance. + * + * @return the scale value. + */ + public Scale scale() { + return this.scale; + } + + /** + * Set the scale property: Scaling properties for the Azure Spring Apps App Instance. + * + * @param scale the scale value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withScale(Scale scale) { + this.scale = scale; + return this; + } + + /** + * Get the containerProbeSettings property: Container liveness and readiness probe settings. + * + * @return the containerProbeSettings value. + */ + public ContainerProbeSettings containerProbeSettings() { + return this.containerProbeSettings; + } + + /** + * Set the containerProbeSettings property: Container liveness and readiness probe settings. + * + * @param containerProbeSettings the containerProbeSettings value to set. + * @return the DeploymentSettings object itself. + */ + public DeploymentSettings withContainerProbeSettings(ContainerProbeSettings containerProbeSettings) { + this.containerProbeSettings = containerProbeSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (apms() != null) { + apms().forEach(e -> e.validate()); + } + if (livenessProbe() != null) { + livenessProbe().validate(); + } + if (readinessProbe() != null) { + readinessProbe().validate(); + } + if (startupProbe() != null) { + startupProbe().validate(); + } + if (scale() != null) { + scale().validate(); + } + if (containerProbeSettings() != null) { + containerProbeSettings().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Deployments.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Deployments.java new file mode 100644 index 0000000000000..17a34fcf6ab68 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Deployments.java @@ -0,0 +1,548 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of Deployments. */ +public interface Deployments { + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get a Deployment and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties. + */ + DeploymentResource get(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Operation to delete a Deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String appName); + + /** + * Handles requests to list all resources in an App. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, + String serviceName, + String appName, + List version, + String expand, + Context context); + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listForCluster(String resourceGroupName, String serviceName); + + /** + * List deployments for a certain service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param version Version of the deployments to be listed. + * @param expand The expand expression to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of App resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, String expand, Context context); + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Start the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Stop the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Restart the deployment. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void restart(String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging enableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Enable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param remoteDebuggingPayload Parameters for enable remote debugging. + * @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 remote debugging config. + */ + RemoteDebugging enableRemoteDebugging( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + RemoteDebuggingPayload remoteDebuggingPayload, + Context context); + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Disable remote debugging. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging disableRemoteDebugging( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config along with {@link Response}. + */ + Response getRemoteDebuggingConfigWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get remote debugging config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return remote debugging config. + */ + RemoteDebugging getRemoteDebuggingConfig( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL along with {@link Response}. + */ + Response getLogFileUrlWithResponse( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context); + + /** + * Get deployment log file URL. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment log file URL. + */ + LogFileUrlResponse getLogFileUrl( + String resourceGroupName, String serviceName, String appName, String deploymentName); + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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 generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Generate Heap Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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 generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Generate Thread Dump. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic 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 startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters); + + /** + * Start JFR. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param appName The name of the App resource. + * @param deploymentName The name of the Deployment resource. + * @param diagnosticParameters Parameters for the diagnostic operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void startJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context); + + /** + * Get a Deployment and its properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response}. + */ + DeploymentResource getById(String id); + + /** + * Get a Deployment and its properties. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Deployment and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete a Deployment. + * + * @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); + + /** + * Operation to delete a Deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DeploymentResource resource. + * + * @param name resource name. + * @return the first stage of the new DeploymentResource definition. + */ + DeploymentResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalComponent.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalComponent.java new file mode 100644 index 0000000000000..9000c07286945 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalComponent.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The DevToolPortalComponent model. */ +@Immutable +public final class DevToolPortalComponent { + /* + * The name property. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests", access = JsonProperty.Access.WRITE_ONLY) + private DevToolPortalResourceRequests resourceRequests; + + /* + * Collection of instances belong to Dev Tool Portal. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of DevToolPortalComponent class. */ + public DevToolPortalComponent() { + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public DevToolPortalResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Get the instances property: Collection of instances belong to Dev Tool Portal. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureDetail.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureDetail.java new file mode 100644 index 0000000000000..c9c3f48b8a3c2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureDetail.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Detail settings for Dev Tool Portal feature. */ +@Fluent +public final class DevToolPortalFeatureDetail { + /* + * State of the plugin + */ + @JsonProperty(value = "state") + private DevToolPortalFeatureState state; + + /* + * Route path to visit the plugin + */ + @JsonProperty(value = "route", access = JsonProperty.Access.WRITE_ONLY) + private String route; + + /** Creates an instance of DevToolPortalFeatureDetail class. */ + public DevToolPortalFeatureDetail() { + } + + /** + * Get the state property: State of the plugin. + * + * @return the state value. + */ + public DevToolPortalFeatureState state() { + return this.state; + } + + /** + * Set the state property: State of the plugin. + * + * @param state the state value to set. + * @return the DevToolPortalFeatureDetail object itself. + */ + public DevToolPortalFeatureDetail withState(DevToolPortalFeatureState state) { + this.state = state; + return this; + } + + /** + * Get the route property: Route path to visit the plugin. + * + * @return the route value. + */ + public String route() { + return this.route; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureSettings.java new file mode 100644 index 0000000000000..05ed77698d666 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureSettings.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Settings for Dev Tool Portal. */ +@Fluent +public final class DevToolPortalFeatureSettings { + /* + * Detail of Accelerator plugin + */ + @JsonProperty(value = "applicationAccelerator") + private DevToolPortalFeatureDetail applicationAccelerator; + + /* + * Detail of App Live View plugin + */ + @JsonProperty(value = "applicationLiveView") + private DevToolPortalFeatureDetail applicationLiveView; + + /** Creates an instance of DevToolPortalFeatureSettings class. */ + public DevToolPortalFeatureSettings() { + } + + /** + * Get the applicationAccelerator property: Detail of Accelerator plugin. + * + * @return the applicationAccelerator value. + */ + public DevToolPortalFeatureDetail applicationAccelerator() { + return this.applicationAccelerator; + } + + /** + * Set the applicationAccelerator property: Detail of Accelerator plugin. + * + * @param applicationAccelerator the applicationAccelerator value to set. + * @return the DevToolPortalFeatureSettings object itself. + */ + public DevToolPortalFeatureSettings withApplicationAccelerator(DevToolPortalFeatureDetail applicationAccelerator) { + this.applicationAccelerator = applicationAccelerator; + return this; + } + + /** + * Get the applicationLiveView property: Detail of App Live View plugin. + * + * @return the applicationLiveView value. + */ + public DevToolPortalFeatureDetail applicationLiveView() { + return this.applicationLiveView; + } + + /** + * Set the applicationLiveView property: Detail of App Live View plugin. + * + * @param applicationLiveView the applicationLiveView value to set. + * @return the DevToolPortalFeatureSettings object itself. + */ + public DevToolPortalFeatureSettings withApplicationLiveView(DevToolPortalFeatureDetail applicationLiveView) { + this.applicationLiveView = applicationLiveView; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (applicationAccelerator() != null) { + applicationAccelerator().validate(); + } + if (applicationLiveView() != null) { + applicationLiveView().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureState.java new file mode 100644 index 0000000000000..b7c46f6ced71e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalFeatureState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the plugin. */ +public final class DevToolPortalFeatureState extends ExpandableStringEnum { + /** Static value Enabled for DevToolPortalFeatureState. */ + public static final DevToolPortalFeatureState ENABLED = fromString("Enabled"); + + /** Static value Disabled for DevToolPortalFeatureState. */ + public static final DevToolPortalFeatureState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of DevToolPortalFeatureState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevToolPortalFeatureState() { + } + + /** + * Creates or finds a DevToolPortalFeatureState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevToolPortalFeatureState. + */ + @JsonCreator + public static DevToolPortalFeatureState fromString(String name) { + return fromString(name, DevToolPortalFeatureState.class); + } + + /** + * Gets known DevToolPortalFeatureState values. + * + * @return known DevToolPortalFeatureState values. + */ + public static Collection values() { + return values(DevToolPortalFeatureState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalInstance.java new file mode 100644 index 0000000000000..6af33b53f00bd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Dev Tool Portal. */ +@Immutable +public final class DevToolPortalInstance { + /* + * Name of the Dev Tool Portal instance. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the Dev Tool Portal instance. It can be Pending, Running, Succeeded, Failed, Unknown. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of DevToolPortalInstance class. */ + public DevToolPortalInstance() { + } + + /** + * Get the name property: Name of the Dev Tool Portal instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the Dev Tool Portal instance. It can be Pending, Running, Succeeded, Failed, + * Unknown. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalProperties.java new file mode 100644 index 0000000000000..061d15a14f130 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Dev Tool Portal properties payload. */ +@Fluent +public final class DevToolPortalProperties { + /* + * State of the Dev Tool Portal. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DevToolPortalProvisioningState provisioningState; + + /* + * Collection of components belong to Dev Tool Portal. + */ + @JsonProperty(value = "components", access = JsonProperty.Access.WRITE_ONLY) + private List components; + + /* + * Indicates whether the resource exposes public endpoint + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /* + * URL of the resource, exposed when 'public' is true. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Single sign-on related configuration + */ + @JsonProperty(value = "ssoProperties") + private DevToolPortalSsoProperties ssoProperties; + + /* + * Settings for Dev Tool Portal + */ + @JsonProperty(value = "features") + private DevToolPortalFeatureSettings features; + + /** Creates an instance of DevToolPortalProperties class. */ + public DevToolPortalProperties() { + } + + /** + * Get the provisioningState property: State of the Dev Tool Portal. + * + * @return the provisioningState value. + */ + public DevToolPortalProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the components property: Collection of components belong to Dev Tool Portal. + * + * @return the components value. + */ + public List components() { + return this.components; + } + + /** + * Get the publicProperty property: Indicates whether the resource exposes public endpoint. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: Indicates whether the resource exposes public endpoint. + * + * @param publicProperty the publicProperty value to set. + * @return the DevToolPortalProperties object itself. + */ + public DevToolPortalProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the url property: URL of the resource, exposed when 'public' is true. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the ssoProperties property: Single sign-on related configuration. + * + * @return the ssoProperties value. + */ + public DevToolPortalSsoProperties ssoProperties() { + return this.ssoProperties; + } + + /** + * Set the ssoProperties property: Single sign-on related configuration. + * + * @param ssoProperties the ssoProperties value to set. + * @return the DevToolPortalProperties object itself. + */ + public DevToolPortalProperties withSsoProperties(DevToolPortalSsoProperties ssoProperties) { + this.ssoProperties = ssoProperties; + return this; + } + + /** + * Get the features property: Settings for Dev Tool Portal. + * + * @return the features value. + */ + public DevToolPortalFeatureSettings features() { + return this.features; + } + + /** + * Set the features property: Settings for Dev Tool Portal. + * + * @param features the features value to set. + * @return the DevToolPortalProperties object itself. + */ + public DevToolPortalProperties withFeatures(DevToolPortalFeatureSettings features) { + this.features = features; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (components() != null) { + components().forEach(e -> e.validate()); + } + if (ssoProperties() != null) { + ssoProperties().validate(); + } + if (features() != null) { + features().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalProvisioningState.java new file mode 100644 index 0000000000000..aaad96b3e24e1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Dev Tool Portal. */ +public final class DevToolPortalProvisioningState extends ExpandableStringEnum { + /** Static value Creating for DevToolPortalProvisioningState. */ + public static final DevToolPortalProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for DevToolPortalProvisioningState. */ + public static final DevToolPortalProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for DevToolPortalProvisioningState. */ + public static final DevToolPortalProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for DevToolPortalProvisioningState. */ + public static final DevToolPortalProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for DevToolPortalProvisioningState. */ + public static final DevToolPortalProvisioningState DELETING = fromString("Deleting"); + + /** Static value Canceled for DevToolPortalProvisioningState. */ + public static final DevToolPortalProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of DevToolPortalProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DevToolPortalProvisioningState() { + } + + /** + * Creates or finds a DevToolPortalProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DevToolPortalProvisioningState. + */ + @JsonCreator + public static DevToolPortalProvisioningState fromString(String name) { + return fromString(name, DevToolPortalProvisioningState.class); + } + + /** + * Gets known DevToolPortalProvisioningState values. + * + * @return known DevToolPortalProvisioningState values. + */ + public static Collection values() { + return values(DevToolPortalProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResource.java new file mode 100644 index 0000000000000..d426181975de4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResource.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DevToolPortalResourceInner; + +/** An immutable client-side representation of DevToolPortalResource. */ +public interface DevToolPortalResource { + /** + * 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 properties property: Dev Tool Portal properties payload. + * + * @return the properties value. + */ + DevToolPortalProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.DevToolPortalResourceInner object. + * + * @return the inner object. + */ + DevToolPortalResourceInner innerModel(); + + /** The entirety of the DevToolPortalResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The DevToolPortalResource definition stages. */ + interface DefinitionStages { + /** The first stage of the DevToolPortalResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the DevToolPortalResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the DevToolPortalResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + DevToolPortalResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DevToolPortalResource create(Context context); + } + + /** The stage of the DevToolPortalResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Dev Tool Portal properties payload. + * + * @param properties Dev Tool Portal properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(DevToolPortalProperties properties); + } + } + + /** + * Begins update for the DevToolPortalResource resource. + * + * @return the stage of resource update. + */ + DevToolPortalResource.Update update(); + + /** The template for DevToolPortalResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DevToolPortalResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DevToolPortalResource apply(Context context); + } + + /** The DevToolPortalResource update stages. */ + interface UpdateStages { + /** The stage of the DevToolPortalResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Dev Tool Portal properties payload. + * + * @param properties Dev Tool Portal properties payload. + * @return the next definition stage. + */ + Update withProperties(DevToolPortalProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DevToolPortalResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DevToolPortalResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResourceCollection.java new file mode 100644 index 0000000000000..35d64844cefa8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DevToolPortalResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Dev Tool Portal resources and a possible link for next set. */ +@Fluent +public final class DevToolPortalResourceCollection { + /* + * Collection of Dev Tool Portal resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of DevToolPortalResourceCollection class. */ + public DevToolPortalResourceCollection() { + } + + /** + * Get the value property: Collection of Dev Tool Portal resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Dev Tool Portal resources. + * + * @param value the value value to set. + * @return the DevToolPortalResourceCollection object itself. + */ + public DevToolPortalResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the DevToolPortalResourceCollection object itself. + */ + public DevToolPortalResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResourceRequests.java new file mode 100644 index 0000000000000..e56bad5fb6a07 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalResourceRequests.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource quantity for required CPU and Memory of Dev Tool Portal. */ +@Immutable +public final class DevToolPortalResourceRequests { + /* + * Cpu quantity allocated to each Dev Tool Portal instance. 1 core can be represented by 1 or 1000m + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory quantity allocated to each Dev Tool Portal instance. 1 GB can be represented by 1Gi or 1024Mi. + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /* + * Desired instance count of Dev Tool Portal. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** Creates an instance of DevToolPortalResourceRequests class. */ + public DevToolPortalResourceRequests() { + } + + /** + * Get the cpu property: Cpu quantity allocated to each Dev Tool Portal instance. 1 core can be represented by 1 or + * 1000m. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory quantity allocated to each Dev Tool Portal instance. 1 GB can be represented by + * 1Gi or 1024Mi. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Get the instanceCount property: Desired instance count of Dev Tool Portal. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalSsoProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalSsoProperties.java new file mode 100644 index 0000000000000..872110e8ed12b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortalSsoProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Single sign-on related configuration. */ +@Fluent +public final class DevToolPortalSsoProperties { + /* + * It defines the specific actions applications can be allowed to do on a user's behalf + */ + @JsonProperty(value = "scopes") + private List scopes; + + /* + * The public identifier for the application + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The secret known only to the application and the authorization server + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * The URI of a JSON file with generic OIDC provider configuration. + */ + @JsonProperty(value = "metadataUrl") + private String metadataUrl; + + /** Creates an instance of DevToolPortalSsoProperties class. */ + public DevToolPortalSsoProperties() { + } + + /** + * Get the scopes property: It defines the specific actions applications can be allowed to do on a user's behalf. + * + * @return the scopes value. + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes property: It defines the specific actions applications can be allowed to do on a user's behalf. + * + * @param scopes the scopes value to set. + * @return the DevToolPortalSsoProperties object itself. + */ + public DevToolPortalSsoProperties withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the clientId property: The public identifier for the application. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The public identifier for the application. + * + * @param clientId the clientId value to set. + * @return the DevToolPortalSsoProperties object itself. + */ + public DevToolPortalSsoProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The secret known only to the application and the authorization server. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The secret known only to the application and the authorization server. + * + * @param clientSecret the clientSecret value to set. + * @return the DevToolPortalSsoProperties object itself. + */ + public DevToolPortalSsoProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the metadataUrl property: The URI of a JSON file with generic OIDC provider configuration. + * + * @return the metadataUrl value. + */ + public String metadataUrl() { + return this.metadataUrl; + } + + /** + * Set the metadataUrl property: The URI of a JSON file with generic OIDC provider configuration. + * + * @param metadataUrl the metadataUrl value to set. + * @return the DevToolPortalSsoProperties object itself. + */ + public DevToolPortalSsoProperties withMetadataUrl(String metadataUrl) { + this.metadataUrl = metadataUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortals.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortals.java new file mode 100644 index 0000000000000..25e2e7475029a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DevToolPortals.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DevToolPortals. */ +public interface DevToolPortals { + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Dev Tool Portal resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @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 Application Live and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String devToolPortalName, Context context); + + /** + * Get the Application Live and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Application Live and its properties. + */ + DevToolPortalResource get(String resourceGroupName, String serviceName, String devToolPortalName); + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String devToolPortalName); + + /** + * Disable the default Dev Tool Portal. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param devToolPortalName The name of Dev Tool Portal. + * @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 serviceName, String devToolPortalName, Context context); + + /** + * Get the Application Live and its properties. + * + * @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 Application Live and its properties along with {@link Response}. + */ + DevToolPortalResource getById(String id); + + /** + * Get the Application Live and its properties. + * + * @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 Application Live and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Disable the default Dev Tool Portal. + * + * @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); + + /** + * Disable the default Dev Tool Portal. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DevToolPortalResource resource. + * + * @param name resource name. + * @return the first stage of the new DevToolPortalResource definition. + */ + DevToolPortalResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DiagnosticParameters.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DiagnosticParameters.java new file mode 100644 index 0000000000000..64d9924deeb4e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DiagnosticParameters.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Diagnostic parameters of diagnostic operations. */ +@Fluent +public final class DiagnosticParameters { + /* + * App instance name + */ + @JsonProperty(value = "appInstance") + private String appInstance; + + /* + * Your target file path in your own BYOS + */ + @JsonProperty(value = "filePath") + private String filePath; + + /* + * Duration of your JFR. 1 min can be represented by 1m or 60s. + */ + @JsonProperty(value = "duration") + private String duration; + + /** Creates an instance of DiagnosticParameters class. */ + public DiagnosticParameters() { + } + + /** + * Get the appInstance property: App instance name. + * + * @return the appInstance value. + */ + public String appInstance() { + return this.appInstance; + } + + /** + * Set the appInstance property: App instance name. + * + * @param appInstance the appInstance value to set. + * @return the DiagnosticParameters object itself. + */ + public DiagnosticParameters withAppInstance(String appInstance) { + this.appInstance = appInstance; + return this; + } + + /** + * Get the filePath property: Your target file path in your own BYOS. + * + * @return the filePath value. + */ + public String filePath() { + return this.filePath; + } + + /** + * Set the filePath property: Your target file path in your own BYOS. + * + * @param filePath the filePath value to set. + * @return the DiagnosticParameters object itself. + */ + public DiagnosticParameters withFilePath(String filePath) { + this.filePath = filePath; + return this; + } + + /** + * Get the duration property: Duration of your JFR. 1 min can be represented by 1m or 60s. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of your JFR. 1 min can be represented by 1m or 60s. + * + * @param duration the duration value to set. + * @return the DiagnosticParameters object itself. + */ + public DiagnosticParameters withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Error.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Error.java new file mode 100644 index 0000000000000..ea84bca14d7db --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Error.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The error code compose of code and message. */ +@Fluent +public final class Error { + /* + * The code of error. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The message of error. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of Error class. */ + public Error() { + } + + /** + * Get the code property: The code of error. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: The code of error. + * + * @param code the code value to set. + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: The message of error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message of error. + * + * @param message the message value to set. + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerEnabledState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerEnabledState.java new file mode 100644 index 0000000000000..ba1375a3301d8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerEnabledState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enabled state of the eureka server. This is only used in Consumption tier. */ +public final class EurekaServerEnabledState extends ExpandableStringEnum { + /** Static value Enabled for EurekaServerEnabledState. */ + public static final EurekaServerEnabledState ENABLED = fromString("Enabled"); + + /** Static value Disabled for EurekaServerEnabledState. */ + public static final EurekaServerEnabledState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of EurekaServerEnabledState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EurekaServerEnabledState() { + } + + /** + * Creates or finds a EurekaServerEnabledState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EurekaServerEnabledState. + */ + @JsonCreator + public static EurekaServerEnabledState fromString(String name) { + return fromString(name, EurekaServerEnabledState.class); + } + + /** + * Gets known EurekaServerEnabledState values. + * + * @return known EurekaServerEnabledState values. + */ + public static Collection values() { + return values(EurekaServerEnabledState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerProperties.java new file mode 100644 index 0000000000000..e95c49aa1a3ea --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Eureka server properties payload. */ +@Fluent +public final class EurekaServerProperties { + /* + * State of the eureka server. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EurekaServerState provisioningState; + + /* + * Enabled state of the eureka server. This is only used in Consumption tier. + */ + @JsonProperty(value = "enabledState") + private EurekaServerEnabledState enabledState; + + /* + * Error when applying eureka server settings. + */ + @JsonProperty(value = "error") + private Error error; + + /** Creates an instance of EurekaServerProperties class. */ + public EurekaServerProperties() { + } + + /** + * Get the provisioningState property: State of the eureka server. + * + * @return the provisioningState value. + */ + public EurekaServerState provisioningState() { + return this.provisioningState; + } + + /** + * Get the enabledState property: Enabled state of the eureka server. This is only used in Consumption tier. + * + * @return the enabledState value. + */ + public EurekaServerEnabledState enabledState() { + return this.enabledState; + } + + /** + * Set the enabledState property: Enabled state of the eureka server. This is only used in Consumption tier. + * + * @param enabledState the enabledState value to set. + * @return the EurekaServerProperties object itself. + */ + public EurekaServerProperties withEnabledState(EurekaServerEnabledState enabledState) { + this.enabledState = enabledState; + return this; + } + + /** + * Get the error property: Error when applying eureka server settings. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when applying eureka server settings. + * + * @param error the error value to set. + * @return the EurekaServerProperties object itself. + */ + public EurekaServerProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerResource.java new file mode 100644 index 0000000000000..ec073473d5a7b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; + +/** An immutable client-side representation of EurekaServerResource. */ +public interface EurekaServerResource { + /** + * 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 properties property: Properties of the eureka server resource. + * + * @return the properties value. + */ + EurekaServerProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner object. + * + * @return the inner object. + */ + EurekaServerResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerResourceCollection.java new file mode 100644 index 0000000000000..dba169a4e6c17 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerResourceCollection.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceCollectionInner; +import java.util.List; + +/** An immutable client-side representation of EurekaServerResourceCollection. */ +public interface EurekaServerResourceCollection { + /** + * Gets the value property: Collection of Eureka server resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceCollectionInner + * object. + * + * @return the inner object. + */ + EurekaServerResourceCollectionInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerState.java new file mode 100644 index 0000000000000..b00e544596ab9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServerState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the eureka server. */ +public final class EurekaServerState extends ExpandableStringEnum { + /** Static value Failed for EurekaServerState. */ + public static final EurekaServerState FAILED = fromString("Failed"); + + /** Static value Succeeded for EurekaServerState. */ + public static final EurekaServerState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for EurekaServerState. */ + public static final EurekaServerState UPDATING = fromString("Updating"); + + /** Static value Canceled for EurekaServerState. */ + public static final EurekaServerState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of EurekaServerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EurekaServerState() { + } + + /** + * Creates or finds a EurekaServerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EurekaServerState. + */ + @JsonCreator + public static EurekaServerState fromString(String name) { + return fromString(name, EurekaServerState.class); + } + + /** + * Gets known EurekaServerState values. + * + * @return known EurekaServerState values. + */ + public static Collection values() { + return values(EurekaServerState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServers.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServers.java new file mode 100644 index 0000000000000..8c5a9cd47b94c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/EurekaServers.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; + +/** Resource collection API of EurekaServers. */ +public interface EurekaServers { + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set along with + * {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * List the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Eureka server resources and a possible link for next set. + */ + EurekaServerResourceCollection list(String resourceGroupName, String serviceName); + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the eureka server settings. + */ + EurekaServerResource get(String resourceGroupName, String serviceName); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update 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 eureka server resource. + */ + EurekaServerResource updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + EurekaServerResource updatePut( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update 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 eureka server resource. + */ + EurekaServerResource updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource); + + /** + * Update the eureka server settings. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param eurekaServerResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return eureka server resource. + */ + EurekaServerResource updatePatch( + String resourceGroupName, String serviceName, EurekaServerResourceInner eurekaServerResource, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ExecAction.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ExecAction.java new file mode 100644 index 0000000000000..9f94256a3d799 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ExecAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** ExecAction describes a "run in container" action. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ExecAction") +@Fluent +public final class ExecAction extends ProbeAction { + /* + * Command is the command line to execute inside the container, the working directory for the command is root ('/') + * in the container's filesystem. The command is not run inside a shell, so traditional shell instructions ('|', + * etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as + * live/healthy and non-zero is unhealthy. + */ + @JsonProperty(value = "command") + private List command; + + /** Creates an instance of ExecAction class. */ + public ExecAction() { + } + + /** + * Get the command property: Command is the command line to execute inside the container, the working directory for + * the command is root ('/') in the container's filesystem. The command is not run inside a shell, so traditional + * shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit + * status of 0 is treated as live/healthy and non-zero is unhealthy. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Command is the command line to execute inside the container, the working directory for + * the command is root ('/') in the container's filesystem. The command is not run inside a shell, so traditional + * shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit + * status of 0 is treated as live/healthy and non-zero is unhealthy. + * + * @param command the command value to set. + * @return the ExecAction object itself. + */ + public ExecAction withCommand(List command) { + this.command = command; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Frequency.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Frequency.java new file mode 100644 index 0000000000000..143d29a0eeac1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Frequency.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The frequency to run the maintenance job. */ +public final class Frequency extends ExpandableStringEnum { + /** Static value Weekly for Frequency. */ + public static final Frequency WEEKLY = fromString("Weekly"); + + /** + * Creates a new instance of Frequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Frequency() { + } + + /** + * Creates or finds a Frequency from its string representation. + * + * @param name a name to look for. + * @return the corresponding Frequency. + */ + @JsonCreator + public static Frequency fromString(String name) { + return fromString(name, Frequency.class); + } + + /** + * Gets known Frequency values. + * + * @return known Frequency values. + */ + public static Collection values() { + return values(Frequency.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiMetadataProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiMetadataProperties.java new file mode 100644 index 0000000000000..aca4d028ae02c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiMetadataProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** API metadata property for Spring Cloud Gateway. */ +@Fluent +public final class GatewayApiMetadataProperties { + /* + * Title describing the context of the APIs available on the Gateway instance (default: `Spring Cloud Gateway for + * K8S`) + */ + @JsonProperty(value = "title") + private String title; + + /* + * Detailed description of the APIs available on the Gateway instance (default: `Generated OpenAPI 3 document that + * describes the API routes configured.`) + */ + @JsonProperty(value = "description") + private String description; + + /* + * Location of additional documentation for the APIs available on the Gateway instance + */ + @JsonProperty(value = "documentation") + private String documentation; + + /* + * Version of APIs available on this Gateway instance (default: `unspecified`). + */ + @JsonProperty(value = "version") + private String version; + + /* + * Base URL that API consumers will use to access APIs on the Gateway instance. + */ + @JsonProperty(value = "serverUrl") + private String serverUrl; + + /** Creates an instance of GatewayApiMetadataProperties class. */ + public GatewayApiMetadataProperties() { + } + + /** + * Get the title property: Title describing the context of the APIs available on the Gateway instance (default: + * `Spring Cloud Gateway for K8S`). + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title describing the context of the APIs available on the Gateway instance (default: + * `Spring Cloud Gateway for K8S`). + * + * @param title the title value to set. + * @return the GatewayApiMetadataProperties object itself. + */ + public GatewayApiMetadataProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: Detailed description of the APIs available on the Gateway instance (default: + * `Generated OpenAPI 3 document that describes the API routes configured.`). + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Detailed description of the APIs available on the Gateway instance (default: + * `Generated OpenAPI 3 document that describes the API routes configured.`). + * + * @param description the description value to set. + * @return the GatewayApiMetadataProperties object itself. + */ + public GatewayApiMetadataProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the documentation property: Location of additional documentation for the APIs available on the Gateway + * instance. + * + * @return the documentation value. + */ + public String documentation() { + return this.documentation; + } + + /** + * Set the documentation property: Location of additional documentation for the APIs available on the Gateway + * instance. + * + * @param documentation the documentation value to set. + * @return the GatewayApiMetadataProperties object itself. + */ + public GatewayApiMetadataProperties withDocumentation(String documentation) { + this.documentation = documentation; + return this; + } + + /** + * Get the version property: Version of APIs available on this Gateway instance (default: `unspecified`). + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of APIs available on this Gateway instance (default: `unspecified`). + * + * @param version the version value to set. + * @return the GatewayApiMetadataProperties object itself. + */ + public GatewayApiMetadataProperties withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the serverUrl property: Base URL that API consumers will use to access APIs on the Gateway instance. + * + * @return the serverUrl value. + */ + public String serverUrl() { + return this.serverUrl; + } + + /** + * Set the serverUrl property: Base URL that API consumers will use to access APIs on the Gateway instance. + * + * @param serverUrl the serverUrl value to set. + * @return the GatewayApiMetadataProperties object itself. + */ + public GatewayApiMetadataProperties withServerUrl(String serverUrl) { + this.serverUrl = serverUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiRoute.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiRoute.java new file mode 100644 index 0000000000000..5848e41bd88f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiRoute.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API route config of the Spring Cloud Gateway. */ +@Fluent +public final class GatewayApiRoute { + /* + * A title, will be applied to methods in the generated OpenAPI documentation. + */ + @JsonProperty(value = "title") + private String title; + + /* + * A description, will be applied to methods in the generated OpenAPI documentation. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Full uri, will override `appName`. + */ + @JsonProperty(value = "uri") + private String uri; + + /* + * Enable sso validation. + */ + @JsonProperty(value = "ssoEnabled") + private Boolean ssoEnabled; + + /* + * Pass currently-authenticated user's identity token to application service, default is 'false' + */ + @JsonProperty(value = "tokenRelay") + private Boolean tokenRelay; + + /* + * A number of conditions to evaluate a route for each request. Each predicate may be evaluated against request + * headers and parameter values. All of the predicates associated with a route must evaluate to true for the route + * to be matched to the request. + */ + @JsonProperty(value = "predicates") + private List predicates; + + /* + * To modify the request before sending it to the target endpoint, or the received response. + */ + @JsonProperty(value = "filters") + private List filters; + + /* + * Route processing order. + */ + @JsonProperty(value = "order") + private Integer order; + + /* + * Classification tags, will be applied to methods in the generated OpenAPI documentation. + */ + @JsonProperty(value = "tags") + private List tags; + + /** Creates an instance of GatewayApiRoute class. */ + public GatewayApiRoute() { + } + + /** + * Get the title property: A title, will be applied to methods in the generated OpenAPI documentation. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: A title, will be applied to methods in the generated OpenAPI documentation. + * + * @param title the title value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description property: A description, will be applied to methods in the generated OpenAPI documentation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A description, will be applied to methods in the generated OpenAPI documentation. + * + * @param description the description value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the uri property: Full uri, will override `appName`. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: Full uri, will override `appName`. + * + * @param uri the uri value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the ssoEnabled property: Enable sso validation. + * + * @return the ssoEnabled value. + */ + public Boolean ssoEnabled() { + return this.ssoEnabled; + } + + /** + * Set the ssoEnabled property: Enable sso validation. + * + * @param ssoEnabled the ssoEnabled value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withSsoEnabled(Boolean ssoEnabled) { + this.ssoEnabled = ssoEnabled; + return this; + } + + /** + * Get the tokenRelay property: Pass currently-authenticated user's identity token to application service, default + * is 'false'. + * + * @return the tokenRelay value. + */ + public Boolean tokenRelay() { + return this.tokenRelay; + } + + /** + * Set the tokenRelay property: Pass currently-authenticated user's identity token to application service, default + * is 'false'. + * + * @param tokenRelay the tokenRelay value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withTokenRelay(Boolean tokenRelay) { + this.tokenRelay = tokenRelay; + return this; + } + + /** + * Get the predicates property: A number of conditions to evaluate a route for each request. Each predicate may be + * evaluated against request headers and parameter values. All of the predicates associated with a route must + * evaluate to true for the route to be matched to the request. + * + * @return the predicates value. + */ + public List predicates() { + return this.predicates; + } + + /** + * Set the predicates property: A number of conditions to evaluate a route for each request. Each predicate may be + * evaluated against request headers and parameter values. All of the predicates associated with a route must + * evaluate to true for the route to be matched to the request. + * + * @param predicates the predicates value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withPredicates(List predicates) { + this.predicates = predicates; + return this; + } + + /** + * Get the filters property: To modify the request before sending it to the target endpoint, or the received + * response. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: To modify the request before sending it to the target endpoint, or the received + * response. + * + * @param filters the filters value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Get the order property: Route processing order. + * + * @return the order value. + */ + public Integer order() { + return this.order; + } + + /** + * Set the order property: Route processing order. + * + * @param order the order value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withOrder(Integer order) { + this.order = order; + return this; + } + + /** + * Get the tags property: Classification tags, will be applied to methods in the generated OpenAPI documentation. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: Classification tags, will be applied to methods in the generated OpenAPI documentation. + * + * @param tags the tags value to set. + * @return the GatewayApiRoute object itself. + */ + public GatewayApiRoute withTags(List 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCertificateVerification.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCertificateVerification.java new file mode 100644 index 0000000000000..8a1f756cc9b4b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCertificateVerification.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether to enable certificate verification or not. */ +public final class GatewayCertificateVerification extends ExpandableStringEnum { + /** Static value Enabled for GatewayCertificateVerification. */ + public static final GatewayCertificateVerification ENABLED = fromString("Enabled"); + + /** Static value Disabled for GatewayCertificateVerification. */ + public static final GatewayCertificateVerification DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of GatewayCertificateVerification value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GatewayCertificateVerification() { + } + + /** + * Creates or finds a GatewayCertificateVerification from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayCertificateVerification. + */ + @JsonCreator + public static GatewayCertificateVerification fromString(String name) { + return fromString(name, GatewayCertificateVerification.class); + } + + /** + * Gets known GatewayCertificateVerification values. + * + * @return known GatewayCertificateVerification values. + */ + public static Collection values() { + return values(GatewayCertificateVerification.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCorsProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCorsProperties.java new file mode 100644 index 0000000000000..cd06bb4dd1065 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCorsProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cross-Origin Resource Sharing property. */ +@Fluent +public final class GatewayCorsProperties { + /* + * Allowed origins to make cross-site requests. The special value `*` allows all domains. + */ + @JsonProperty(value = "allowedOrigins") + private List allowedOrigins; + + /* + * Allowed origin patterns to make cross-site requests. + */ + @JsonProperty(value = "allowedOriginPatterns") + private List allowedOriginPatterns; + + /* + * Allowed HTTP methods on cross-site requests. The special value `*` allows all methods. If not set, `GET` and + * `HEAD` are allowed by default. + */ + @JsonProperty(value = "allowedMethods") + private List allowedMethods; + + /* + * Allowed headers in cross-site requests. The special value `*` allows actual requests to send any header. + */ + @JsonProperty(value = "allowedHeaders") + private List allowedHeaders; + + /* + * How long, in seconds, the response from a pre-flight request can be cached by clients. + */ + @JsonProperty(value = "maxAge") + private Integer maxAge; + + /* + * Whether user credentials are supported on cross-site requests. Valid values: `true`, `false`. + */ + @JsonProperty(value = "allowCredentials") + private Boolean allowCredentials; + + /* + * HTTP response headers to expose for cross-site requests. + */ + @JsonProperty(value = "exposedHeaders") + private List exposedHeaders; + + /** Creates an instance of GatewayCorsProperties class. */ + public GatewayCorsProperties() { + } + + /** + * Get the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all + * domains. + * + * @return the allowedOrigins value. + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all + * domains. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests. + * + * @return the allowedOriginPatterns value. + */ + public List allowedOriginPatterns() { + return this.allowedOriginPatterns; + } + + /** + * Set the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests. + * + * @param allowedOriginPatterns the allowedOriginPatterns value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withAllowedOriginPatterns(List allowedOriginPatterns) { + this.allowedOriginPatterns = allowedOriginPatterns; + return this; + } + + /** + * Get the allowedMethods property: Allowed HTTP methods on cross-site requests. The special value `*` allows all + * methods. If not set, `GET` and `HEAD` are allowed by default. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: Allowed HTTP methods on cross-site requests. The special value `*` allows all + * methods. If not set, `GET` and `HEAD` are allowed by default. + * + * @param allowedMethods the allowedMethods value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the allowedHeaders property: Allowed headers in cross-site requests. The special value `*` allows actual + * requests to send any header. + * + * @return the allowedHeaders value. + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the allowedHeaders property: Allowed headers in cross-site requests. The special value `*` allows actual + * requests to send any header. + * + * @param allowedHeaders the allowedHeaders value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Get the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients. + * + * @return the maxAge value. + */ + public Integer maxAge() { + return this.maxAge; + } + + /** + * Set the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients. + * + * @param maxAge the maxAge value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withMaxAge(Integer maxAge) { + this.maxAge = maxAge; + return this; + } + + /** + * Get the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: + * `true`, `false`. + * + * @return the allowCredentials value. + */ + public Boolean allowCredentials() { + return this.allowCredentials; + } + + /** + * Set the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: + * `true`, `false`. + * + * @param allowCredentials the allowCredentials value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withAllowCredentials(Boolean allowCredentials) { + this.allowCredentials = allowCredentials; + return this; + } + + /** + * Get the exposedHeaders property: HTTP response headers to expose for cross-site requests. + * + * @return the exposedHeaders value. + */ + public List exposedHeaders() { + return this.exposedHeaders; + } + + /** + * Set the exposedHeaders property: HTTP response headers to expose for cross-site requests. + * + * @param exposedHeaders the exposedHeaders value to set. + * @return the GatewayCorsProperties object itself. + */ + public GatewayCorsProperties withExposedHeaders(List exposedHeaders) { + this.exposedHeaders = exposedHeaders; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainProperties.java new file mode 100644 index 0000000000000..3e227126c6a5b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of custom domain for Spring Cloud Gateway. */ +@Fluent +public final class GatewayCustomDomainProperties { + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** Creates an instance of GatewayCustomDomainProperties class. */ + public GatewayCustomDomainProperties() { + } + + /** + * Get the thumbprint property: The thumbprint of bound certificate. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint property: The thumbprint of bound certificate. + * + * @param thumbprint the thumbprint value to set. + * @return the GatewayCustomDomainProperties object itself. + */ + public GatewayCustomDomainProperties withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResource.java new file mode 100644 index 0000000000000..2defabf8adf30 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; + +/** An immutable client-side representation of GatewayCustomDomainResource. */ +public interface GatewayCustomDomainResource { + /** + * 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 properties property: The properties of custom domain for Spring Cloud Gateway. + * + * @return the properties value. + */ + GatewayCustomDomainProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner + * object. + * + * @return the inner object. + */ + GatewayCustomDomainResourceInner innerModel(); + + /** The entirety of the GatewayCustomDomainResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The GatewayCustomDomainResource definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayCustomDomainResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the GatewayCustomDomainResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, gatewayName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @return the next definition stage. + */ + WithCreate withExistingGateway(String resourceGroupName, String serviceName, String gatewayName); + } + + /** + * The stage of the GatewayCustomDomainResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayCustomDomainResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayCustomDomainResource create(Context context); + } + + /** The stage of the GatewayCustomDomainResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of custom domain for Spring Cloud Gateway. + * + * @param properties The properties of custom domain for Spring Cloud Gateway. + * @return the next definition stage. + */ + WithCreate withProperties(GatewayCustomDomainProperties properties); + } + } + + /** + * Begins update for the GatewayCustomDomainResource resource. + * + * @return the stage of resource update. + */ + GatewayCustomDomainResource.Update update(); + + /** The template for GatewayCustomDomainResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GatewayCustomDomainResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GatewayCustomDomainResource apply(Context context); + } + + /** The GatewayCustomDomainResource update stages. */ + interface UpdateStages { + /** The stage of the GatewayCustomDomainResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties of custom domain for Spring Cloud Gateway. + * + * @param properties The properties of custom domain for Spring Cloud Gateway. + * @return the next definition stage. + */ + Update withProperties(GatewayCustomDomainProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayCustomDomainResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayCustomDomainResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResourceCollection.java new file mode 100644 index 0000000000000..922dcef142f00 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for next set. */ +@Fluent +public final class GatewayCustomDomainResourceCollection { + /* + * Collection of Spring Cloud Gateway custom domain resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GatewayCustomDomainResourceCollection class. */ + public GatewayCustomDomainResourceCollection() { + } + + /** + * Get the value property: Collection of Spring Cloud Gateway custom domain resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Spring Cloud Gateway custom domain resources. + * + * @param value the value value to set. + * @return the GatewayCustomDomainResourceCollection object itself. + */ + public GatewayCustomDomainResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the GatewayCustomDomainResourceCollection object itself. + */ + public GatewayCustomDomainResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomains.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomains.java new file mode 100644 index 0000000000000..3172f4a2f730b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomains.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of GatewayCustomDomains. */ +public interface GatewayCustomDomains { + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @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 Spring Cloud Gateway custom domain along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String domainName, Context context); + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway custom domain. + */ + GatewayCustomDomainResource get( + String resourceGroupName, String serviceName, String gatewayName, String domainName); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayName, String domainName); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param domainName The name of the Spring Cloud Gateway custom domain. + * @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 serviceName, String gatewayName, String domainName, Context context); + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Handle requests to list all Spring Cloud Gateway custom domains. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for + * next set as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @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 Spring Cloud Gateway custom domain along with {@link Response}. + */ + GatewayCustomDomainResource getById(String id); + + /** + * Get the Spring Cloud Gateway custom domain. + * + * @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 Spring Cloud Gateway custom domain along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the Spring Cloud Gateway custom domain. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GatewayCustomDomainResource resource. + * + * @param name resource name. + * @return the first stage of the new GatewayCustomDomainResource definition. + */ + GatewayCustomDomainResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayInstance.java new file mode 100644 index 0000000000000..e0d655e76e92f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Spring Cloud Gateway. */ +@Immutable +public final class GatewayInstance { + /* + * Name of the Spring Cloud Gateway instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the Spring Cloud Gateway instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of GatewayInstance class. */ + public GatewayInstance() { + } + + /** + * Get the name property: Name of the Spring Cloud Gateway instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the Spring Cloud Gateway instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayOperatorProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayOperatorProperties.java new file mode 100644 index 0000000000000..dd4bac3431237 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayOperatorProperties.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Spring Cloud Gateway Operator. */ +@Immutable +public final class GatewayOperatorProperties { + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests", access = JsonProperty.Access.WRITE_ONLY) + private GatewayOperatorResourceRequests resourceRequests; + + /* + * Collection of instances belong to Spring Cloud Gateway operator. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of GatewayOperatorProperties class. */ + public GatewayOperatorProperties() { + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public GatewayOperatorResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Get the instances property: Collection of instances belong to Spring Cloud Gateway operator. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayOperatorResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayOperatorResourceRequests.java new file mode 100644 index 0000000000000..e08f942c88090 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayOperatorResourceRequests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Spring Cloud Gateway Operator. */ +@Immutable +public final class GatewayOperatorResourceRequests { + /* + * Cpu allocated to each Spring Cloud Gateway Operator instance. + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory allocated to each Spring Cloud Gateway Operator instance. + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /* + * Instance count of the Spring Cloud Gateway Operator. + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** Creates an instance of GatewayOperatorResourceRequests class. */ + public GatewayOperatorResourceRequests() { + } + + /** + * Get the cpu property: Cpu allocated to each Spring Cloud Gateway Operator instance. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory allocated to each Spring Cloud Gateway Operator instance. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Get the instanceCount property: Instance count of the Spring Cloud Gateway Operator. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProperties.java new file mode 100644 index 0000000000000..4095d9395e7e8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProperties.java @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Spring Cloud Gateway properties payload. */ +@Fluent +public final class GatewayProperties { + /* + * State of the Spring Cloud Gateway. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GatewayProvisioningState provisioningState; + + /* + * Indicates whether the Spring Cloud Gateway exposes endpoint. + */ + @JsonProperty(value = "public") + private Boolean publicProperty; + + /* + * URL of the Spring Cloud Gateway, exposed when 'public' is true. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /* + * Indicate if only https is allowed. + */ + @JsonProperty(value = "httpsOnly") + private Boolean httpsOnly; + + /* + * Single sign-on related configuration + */ + @JsonProperty(value = "ssoProperties") + private SsoProperties ssoProperties; + + /* + * API metadata property for Spring Cloud Gateway + */ + @JsonProperty(value = "apiMetadataProperties") + private GatewayApiMetadataProperties apiMetadataProperties; + + /* + * Cross-Origin Resource Sharing property + */ + @JsonProperty(value = "corsProperties") + private GatewayCorsProperties corsProperties; + + /* + * Client-Certification Authentication. + */ + @JsonProperty(value = "clientAuth") + private GatewayPropertiesClientAuth clientAuth; + + /* + * Collection of APM type used in Spring Cloud Gateway + */ + @JsonProperty(value = "apmTypes") + private List apmTypes; + + /* + * Collection of ApmReferences in service level + */ + @JsonProperty(value = "apms") + private List apms; + + /* + * Environment variables of Spring Cloud Gateway + */ + @JsonProperty(value = "environmentVariables") + private GatewayPropertiesEnvironmentVariables environmentVariables; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests") + private GatewayResourceRequests resourceRequests; + + /* + * Collection of addons for Spring Cloud Gateway + */ + @JsonProperty(value = "addonConfigs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map addonConfigs; + + /* + * Collection of instances belong to Spring Cloud Gateway. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /* + * Properties of the Spring Cloud Gateway Operator. + */ + @JsonProperty(value = "operatorProperties", access = JsonProperty.Access.WRITE_ONLY) + private GatewayOperatorProperties operatorProperties; + + /** Creates an instance of GatewayProperties class. */ + public GatewayProperties() { + } + + /** + * Get the provisioningState property: State of the Spring Cloud Gateway. + * + * @return the provisioningState value. + */ + public GatewayProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the publicProperty property: Indicates whether the Spring Cloud Gateway exposes endpoint. + * + * @return the publicProperty value. + */ + public Boolean publicProperty() { + return this.publicProperty; + } + + /** + * Set the publicProperty property: Indicates whether the Spring Cloud Gateway exposes endpoint. + * + * @param publicProperty the publicProperty value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withPublicProperty(Boolean publicProperty) { + this.publicProperty = publicProperty; + return this; + } + + /** + * Get the url property: URL of the Spring Cloud Gateway, exposed when 'public' is true. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the httpsOnly property: Indicate if only https is allowed. + * + * @return the httpsOnly value. + */ + public Boolean httpsOnly() { + return this.httpsOnly; + } + + /** + * Set the httpsOnly property: Indicate if only https is allowed. + * + * @param httpsOnly the httpsOnly value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withHttpsOnly(Boolean httpsOnly) { + this.httpsOnly = httpsOnly; + return this; + } + + /** + * Get the ssoProperties property: Single sign-on related configuration. + * + * @return the ssoProperties value. + */ + public SsoProperties ssoProperties() { + return this.ssoProperties; + } + + /** + * Set the ssoProperties property: Single sign-on related configuration. + * + * @param ssoProperties the ssoProperties value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withSsoProperties(SsoProperties ssoProperties) { + this.ssoProperties = ssoProperties; + return this; + } + + /** + * Get the apiMetadataProperties property: API metadata property for Spring Cloud Gateway. + * + * @return the apiMetadataProperties value. + */ + public GatewayApiMetadataProperties apiMetadataProperties() { + return this.apiMetadataProperties; + } + + /** + * Set the apiMetadataProperties property: API metadata property for Spring Cloud Gateway. + * + * @param apiMetadataProperties the apiMetadataProperties value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withApiMetadataProperties(GatewayApiMetadataProperties apiMetadataProperties) { + this.apiMetadataProperties = apiMetadataProperties; + return this; + } + + /** + * Get the corsProperties property: Cross-Origin Resource Sharing property. + * + * @return the corsProperties value. + */ + public GatewayCorsProperties corsProperties() { + return this.corsProperties; + } + + /** + * Set the corsProperties property: Cross-Origin Resource Sharing property. + * + * @param corsProperties the corsProperties value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withCorsProperties(GatewayCorsProperties corsProperties) { + this.corsProperties = corsProperties; + return this; + } + + /** + * Get the clientAuth property: Client-Certification Authentication. + * + * @return the clientAuth value. + */ + public GatewayPropertiesClientAuth clientAuth() { + return this.clientAuth; + } + + /** + * Set the clientAuth property: Client-Certification Authentication. + * + * @param clientAuth the clientAuth value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withClientAuth(GatewayPropertiesClientAuth clientAuth) { + this.clientAuth = clientAuth; + return this; + } + + /** + * Get the apmTypes property: Collection of APM type used in Spring Cloud Gateway. + * + * @return the apmTypes value. + */ + public List apmTypes() { + return this.apmTypes; + } + + /** + * Set the apmTypes property: Collection of APM type used in Spring Cloud Gateway. + * + * @param apmTypes the apmTypes value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withApmTypes(List apmTypes) { + this.apmTypes = apmTypes; + return this; + } + + /** + * Get the apms property: Collection of ApmReferences in service level. + * + * @return the apms value. + */ + public List apms() { + return this.apms; + } + + /** + * Set the apms property: Collection of ApmReferences in service level. + * + * @param apms the apms value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withApms(List apms) { + this.apms = apms; + return this; + } + + /** + * Get the environmentVariables property: Environment variables of Spring Cloud Gateway. + * + * @return the environmentVariables value. + */ + public GatewayPropertiesEnvironmentVariables environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environmentVariables property: Environment variables of Spring Cloud Gateway. + * + * @param environmentVariables the environmentVariables value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withEnvironmentVariables(GatewayPropertiesEnvironmentVariables environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public GatewayResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Set the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @param resourceRequests the resourceRequests value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withResourceRequests(GatewayResourceRequests resourceRequests) { + this.resourceRequests = resourceRequests; + return this; + } + + /** + * Get the addonConfigs property: Collection of addons for Spring Cloud Gateway. + * + * @return the addonConfigs value. + */ + public Map addonConfigs() { + return this.addonConfigs; + } + + /** + * Set the addonConfigs property: Collection of addons for Spring Cloud Gateway. + * + * @param addonConfigs the addonConfigs value to set. + * @return the GatewayProperties object itself. + */ + public GatewayProperties withAddonConfigs(Map addonConfigs) { + this.addonConfigs = addonConfigs; + return this; + } + + /** + * Get the instances property: Collection of instances belong to Spring Cloud Gateway. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Get the operatorProperties property: Properties of the Spring Cloud Gateway Operator. + * + * @return the operatorProperties value. + */ + public GatewayOperatorProperties operatorProperties() { + return this.operatorProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ssoProperties() != null) { + ssoProperties().validate(); + } + if (apiMetadataProperties() != null) { + apiMetadataProperties().validate(); + } + if (corsProperties() != null) { + corsProperties().validate(); + } + if (clientAuth() != null) { + clientAuth().validate(); + } + if (apms() != null) { + apms().forEach(e -> e.validate()); + } + if (environmentVariables() != null) { + environmentVariables().validate(); + } + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + if (operatorProperties() != null) { + operatorProperties().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayPropertiesClientAuth.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayPropertiesClientAuth.java new file mode 100644 index 0000000000000..8172115f2fba9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayPropertiesClientAuth.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Client-Certification Authentication. */ +@Fluent +public final class GatewayPropertiesClientAuth { + /* + * Collection of certificate resource Ids in Azure Spring Apps. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /* + * Whether to enable certificate verification or not + */ + @JsonProperty(value = "certificateVerification") + private GatewayCertificateVerification certificateVerification; + + /** Creates an instance of GatewayPropertiesClientAuth class. */ + public GatewayPropertiesClientAuth() { + } + + /** + * Get the certificates property: Collection of certificate resource Ids in Azure Spring Apps. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: Collection of certificate resource Ids in Azure Spring Apps. + * + * @param certificates the certificates value to set. + * @return the GatewayPropertiesClientAuth object itself. + */ + public GatewayPropertiesClientAuth withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the certificateVerification property: Whether to enable certificate verification or not. + * + * @return the certificateVerification value. + */ + public GatewayCertificateVerification certificateVerification() { + return this.certificateVerification; + } + + /** + * Set the certificateVerification property: Whether to enable certificate verification or not. + * + * @param certificateVerification the certificateVerification value to set. + * @return the GatewayPropertiesClientAuth object itself. + */ + public GatewayPropertiesClientAuth withCertificateVerification( + GatewayCertificateVerification certificateVerification) { + this.certificateVerification = certificateVerification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayPropertiesEnvironmentVariables.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayPropertiesEnvironmentVariables.java new file mode 100644 index 0000000000000..4d55e289075b8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayPropertiesEnvironmentVariables.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Environment variables of Spring Cloud Gateway. */ +@Fluent +public final class GatewayPropertiesEnvironmentVariables { + /* + * Non-sensitive properties + */ + @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + + /* + * Sensitive properties + */ + @JsonProperty(value = "secrets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map secrets; + + /** Creates an instance of GatewayPropertiesEnvironmentVariables class. */ + public GatewayPropertiesEnvironmentVariables() { + } + + /** + * Get the properties property: Non-sensitive properties. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Non-sensitive properties. + * + * @param properties the properties value to set. + * @return the GatewayPropertiesEnvironmentVariables object itself. + */ + public GatewayPropertiesEnvironmentVariables withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Get the secrets property: Sensitive properties. + * + * @return the secrets value. + */ + public Map secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Sensitive properties. + * + * @param secrets the secrets value to set. + * @return the GatewayPropertiesEnvironmentVariables object itself. + */ + public GatewayPropertiesEnvironmentVariables withSecrets(Map secrets) { + this.secrets = secrets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProvisioningState.java new file mode 100644 index 0000000000000..6b3a4e7e93e05 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Spring Cloud Gateway. */ +public final class GatewayProvisioningState extends ExpandableStringEnum { + /** Static value Creating for GatewayProvisioningState. */ + public static final GatewayProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for GatewayProvisioningState. */ + public static final GatewayProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for GatewayProvisioningState. */ + public static final GatewayProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for GatewayProvisioningState. */ + public static final GatewayProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for GatewayProvisioningState. */ + public static final GatewayProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of GatewayProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GatewayProvisioningState() { + } + + /** + * Creates or finds a GatewayProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayProvisioningState. + */ + @JsonCreator + public static GatewayProvisioningState fromString(String name) { + return fromString(name, GatewayProvisioningState.class); + } + + /** + * Gets known GatewayProvisioningState values. + * + * @return known GatewayProvisioningState values. + */ + public static Collection values() { + return values(GatewayProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResource.java new file mode 100644 index 0000000000000..e6e9645e557d3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResource.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import java.util.Map; + +/** An immutable client-side representation of GatewayResource. */ +public interface GatewayResource { + /** + * 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 properties property: Spring Cloud Gateway properties payload. + * + * @return the properties value. + */ + GatewayProperties properties(); + + /** + * Gets the sku property: Sku of the Spring Cloud Gateway 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 name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner object. + * + * @return the inner object. + */ + GatewayResourceInner innerModel(); + + /** The entirety of the GatewayResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The GatewayResource definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the GatewayResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the GatewayResource 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.WithProperties, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayResource create(Context context); + } + + /** The stage of the GatewayResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Spring Cloud Gateway properties payload. + * + * @param properties Spring Cloud Gateway properties payload. + * @return the next definition stage. + */ + WithCreate withProperties(GatewayProperties properties); + } + + /** The stage of the GatewayResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the Spring Cloud Gateway resource. + * + * @param sku Sku of the Spring Cloud Gateway resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the GatewayResource resource. + * + * @return the stage of resource update. + */ + GatewayResource.Update update(); + + /** The template for GatewayResource update. */ + interface Update extends UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GatewayResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GatewayResource apply(Context context); + } + + /** The GatewayResource update stages. */ + interface UpdateStages { + /** The stage of the GatewayResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the Spring Cloud Gateway resource. + * + * @param sku Sku of the Spring Cloud Gateway resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayResource refresh(Context context); + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @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 sensitive properties for Spring Cloud Gateway along with {@link Response}. + */ + Response> listEnvSecretsWithResponse(Context context); + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway. + */ + Map listEnvSecrets(); + + /** + * Restart the Spring Cloud Gateway. + * + * @throws com.azure.core.management.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 restart(); + + /** + * Restart the Spring Cloud Gateway. + * + * @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 restart(Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResourceCollection.java new file mode 100644 index 0000000000000..ee1a751e8227f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of gateway resources and a possible link for next set. */ +@Fluent +public final class GatewayResourceCollection { + /* + * Collection of gateway resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GatewayResourceCollection class. */ + public GatewayResourceCollection() { + } + + /** + * Get the value property: Collection of gateway resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of gateway resources. + * + * @param value the value value to set. + * @return the GatewayResourceCollection object itself. + */ + public GatewayResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the GatewayResourceCollection object itself. + */ + public GatewayResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResourceRequests.java new file mode 100644 index 0000000000000..951779f60fb5c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResourceRequests.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Spring Cloud Gateway. */ +@Fluent +public final class GatewayResourceRequests { + /* + * Cpu allocated to each Spring Cloud Gateway instance. + */ + @JsonProperty(value = "cpu") + private String cpu; + + /* + * Memory allocated to each Spring Cloud Gateway instance. + */ + @JsonProperty(value = "memory") + private String memory; + + /** Creates an instance of GatewayResourceRequests class. */ + public GatewayResourceRequests() { + } + + /** + * Get the cpu property: Cpu allocated to each Spring Cloud Gateway instance. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Cpu allocated to each Spring Cloud Gateway instance. + * + * @param cpu the cpu value to set. + * @return the GatewayResourceRequests object itself. + */ + public GatewayResourceRequests withCpu(String cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Memory allocated to each Spring Cloud Gateway instance. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Memory allocated to each Spring Cloud Gateway instance. + * + * @param memory the memory value to set. + * @return the GatewayResourceRequests object itself. + */ + public GatewayResourceRequests withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigOpenApiProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigOpenApiProperties.java new file mode 100644 index 0000000000000..3069081f03863 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigOpenApiProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** OpenAPI properties of Spring Cloud Gateway route config. */ +@Fluent +public final class GatewayRouteConfigOpenApiProperties { + /* + * The URI of OpenAPI specification. + */ + @JsonProperty(value = "uri") + private String uri; + + /** Creates an instance of GatewayRouteConfigOpenApiProperties class. */ + public GatewayRouteConfigOpenApiProperties() { + } + + /** + * Get the uri property: The URI of OpenAPI specification. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: The URI of OpenAPI specification. + * + * @param uri the uri value to set. + * @return the GatewayRouteConfigOpenApiProperties object itself. + */ + public GatewayRouteConfigOpenApiProperties withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProperties.java new file mode 100644 index 0000000000000..70312858eeaa9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProperties.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API route config of the Spring Cloud Gateway. */ +@Fluent +public final class GatewayRouteConfigProperties { + /* + * State of the Spring Cloud Gateway route config. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private GatewayProvisioningState provisioningState; + + /* + * The resource Id of the Azure Spring Apps app, required unless route defines `uri`. + */ + @JsonProperty(value = "appResourceId") + private String appResourceId; + + /* + * OpenAPI properties of Spring Cloud Gateway route config. + */ + @JsonProperty(value = "openApi") + private GatewayRouteConfigOpenApiProperties openApi; + + /* + * Protocol of routed Azure Spring Apps applications. + */ + @JsonProperty(value = "protocol") + private GatewayRouteConfigProtocol protocol; + + /* + * Array of API routes, each route contains properties such as `title`, `uri`, `ssoEnabled`, `predicates`, + * `filters`. + */ + @JsonProperty(value = "routes") + private List routes; + + /* + * Enable Single Sign-On in app level. + */ + @JsonProperty(value = "ssoEnabled") + private Boolean ssoEnabled; + + /* + * A number of conditions to evaluate a route for each request in app level. Each predicate may be evaluated + * against request headers and parameter values. All of the predicates associated with a route must evaluate to + * true for the route to be matched to the request. + */ + @JsonProperty(value = "predicates") + private List predicates; + + /* + * To modify the request before sending it to the target endpoint, or the received response in app level. + */ + @JsonProperty(value = "filters") + private List filters; + + /** Creates an instance of GatewayRouteConfigProperties class. */ + public GatewayRouteConfigProperties() { + } + + /** + * Get the provisioningState property: State of the Spring Cloud Gateway route config. + * + * @return the provisioningState value. + */ + public GatewayProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the appResourceId property: The resource Id of the Azure Spring Apps app, required unless route defines + * `uri`. + * + * @return the appResourceId value. + */ + public String appResourceId() { + return this.appResourceId; + } + + /** + * Set the appResourceId property: The resource Id of the Azure Spring Apps app, required unless route defines + * `uri`. + * + * @param appResourceId the appResourceId value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withAppResourceId(String appResourceId) { + this.appResourceId = appResourceId; + return this; + } + + /** + * Get the openApi property: OpenAPI properties of Spring Cloud Gateway route config. + * + * @return the openApi value. + */ + public GatewayRouteConfigOpenApiProperties openApi() { + return this.openApi; + } + + /** + * Set the openApi property: OpenAPI properties of Spring Cloud Gateway route config. + * + * @param openApi the openApi value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withOpenApi(GatewayRouteConfigOpenApiProperties openApi) { + this.openApi = openApi; + return this; + } + + /** + * Get the protocol property: Protocol of routed Azure Spring Apps applications. + * + * @return the protocol value. + */ + public GatewayRouteConfigProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Protocol of routed Azure Spring Apps applications. + * + * @param protocol the protocol value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withProtocol(GatewayRouteConfigProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the routes property: Array of API routes, each route contains properties such as `title`, `uri`, + * `ssoEnabled`, `predicates`, `filters`. + * + * @return the routes value. + */ + public List routes() { + return this.routes; + } + + /** + * Set the routes property: Array of API routes, each route contains properties such as `title`, `uri`, + * `ssoEnabled`, `predicates`, `filters`. + * + * @param routes the routes value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withRoutes(List routes) { + this.routes = routes; + return this; + } + + /** + * Get the ssoEnabled property: Enable Single Sign-On in app level. + * + * @return the ssoEnabled value. + */ + public Boolean ssoEnabled() { + return this.ssoEnabled; + } + + /** + * Set the ssoEnabled property: Enable Single Sign-On in app level. + * + * @param ssoEnabled the ssoEnabled value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withSsoEnabled(Boolean ssoEnabled) { + this.ssoEnabled = ssoEnabled; + return this; + } + + /** + * Get the predicates property: A number of conditions to evaluate a route for each request in app level. Each + * predicate may be evaluated against request headers and parameter values. All of the predicates associated with a + * route must evaluate to true for the route to be matched to the request. + * + * @return the predicates value. + */ + public List predicates() { + return this.predicates; + } + + /** + * Set the predicates property: A number of conditions to evaluate a route for each request in app level. Each + * predicate may be evaluated against request headers and parameter values. All of the predicates associated with a + * route must evaluate to true for the route to be matched to the request. + * + * @param predicates the predicates value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withPredicates(List predicates) { + this.predicates = predicates; + return this; + } + + /** + * Get the filters property: To modify the request before sending it to the target endpoint, or the received + * response in app level. + * + * @return the filters value. + */ + public List filters() { + return this.filters; + } + + /** + * Set the filters property: To modify the request before sending it to the target endpoint, or the received + * response in app level. + * + * @param filters the filters value to set. + * @return the GatewayRouteConfigProperties object itself. + */ + public GatewayRouteConfigProperties withFilters(List filters) { + this.filters = filters; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (openApi() != null) { + openApi().validate(); + } + if (routes() != null) { + routes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProtocol.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProtocol.java new file mode 100644 index 0000000000000..326f7f8f39bff --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProtocol.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Protocol of routed Azure Spring Apps applications. */ +public final class GatewayRouteConfigProtocol extends ExpandableStringEnum { + /** Static value HTTP for GatewayRouteConfigProtocol. */ + public static final GatewayRouteConfigProtocol HTTP = fromString("HTTP"); + + /** Static value HTTPS for GatewayRouteConfigProtocol. */ + public static final GatewayRouteConfigProtocol HTTPS = fromString("HTTPS"); + + /** + * Creates a new instance of GatewayRouteConfigProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GatewayRouteConfigProtocol() { + } + + /** + * Creates or finds a GatewayRouteConfigProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayRouteConfigProtocol. + */ + @JsonCreator + public static GatewayRouteConfigProtocol fromString(String name) { + return fromString(name, GatewayRouteConfigProtocol.class); + } + + /** + * Gets known GatewayRouteConfigProtocol values. + * + * @return known GatewayRouteConfigProtocol values. + */ + public static Collection values() { + return values(GatewayRouteConfigProtocol.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResource.java new file mode 100644 index 0000000000000..7ae40a28471e5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; + +/** An immutable client-side representation of GatewayRouteConfigResource. */ +public interface GatewayRouteConfigResource { + /** + * 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 properties property: API route config of the Spring Cloud Gateway. + * + * @return the properties value. + */ + GatewayRouteConfigProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner + * object. + * + * @return the inner object. + */ + GatewayRouteConfigResourceInner innerModel(); + + /** The entirety of the GatewayRouteConfigResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The GatewayRouteConfigResource definition stages. */ + interface DefinitionStages { + /** The first stage of the GatewayRouteConfigResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the GatewayRouteConfigResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName, gatewayName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @return the next definition stage. + */ + WithCreate withExistingGateway(String resourceGroupName, String serviceName, String gatewayName); + } + + /** + * The stage of the GatewayRouteConfigResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + GatewayRouteConfigResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GatewayRouteConfigResource create(Context context); + } + + /** The stage of the GatewayRouteConfigResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: API route config of the Spring Cloud Gateway. + * + * @param properties API route config of the Spring Cloud Gateway. + * @return the next definition stage. + */ + WithCreate withProperties(GatewayRouteConfigProperties properties); + } + } + + /** + * Begins update for the GatewayRouteConfigResource resource. + * + * @return the stage of resource update. + */ + GatewayRouteConfigResource.Update update(); + + /** The template for GatewayRouteConfigResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GatewayRouteConfigResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GatewayRouteConfigResource apply(Context context); + } + + /** The GatewayRouteConfigResource update stages. */ + interface UpdateStages { + /** The stage of the GatewayRouteConfigResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: API route config of the Spring Cloud Gateway. + * + * @param properties API route config of the Spring Cloud Gateway. + * @return the next definition stage. + */ + Update withProperties(GatewayRouteConfigProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GatewayRouteConfigResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GatewayRouteConfigResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResourceCollection.java new file mode 100644 index 0000000000000..b942acbfba1b9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Spring Cloud Gateway route config resources and a possible link for next set. */ +@Fluent +public final class GatewayRouteConfigResourceCollection { + /* + * Collection of Spring Cloud Gateway route config resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of GatewayRouteConfigResourceCollection class. */ + public GatewayRouteConfigResourceCollection() { + } + + /** + * Get the value property: Collection of Spring Cloud Gateway route config resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Spring Cloud Gateway route config resources. + * + * @param value the value value to set. + * @return the GatewayRouteConfigResourceCollection object itself. + */ + public GatewayRouteConfigResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the GatewayRouteConfigResourceCollection object itself. + */ + public GatewayRouteConfigResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigs.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigs.java new file mode 100644 index 0000000000000..f388843c161f4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigs.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of GatewayRouteConfigs. */ +public interface GatewayRouteConfigs { + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @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 Spring Cloud Gateway route configs along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, Context context); + + /** + * Get the Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway route configs. + */ + GatewayRouteConfigResource get( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayName, String routeConfigName); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param routeConfigName The name of the Spring Cloud Gateway route config. + * @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 serviceName, String gatewayName, String routeConfigName, Context context); + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Handle requests to list all Spring Cloud Gateway route configs. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 object that includes an array of Spring Cloud Gateway route config resources and a possible link for next + * set as paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Get the Spring Cloud Gateway route configs. + * + * @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 Spring Cloud Gateway route configs along with {@link Response}. + */ + GatewayRouteConfigResource getById(String id); + + /** + * Get the Spring Cloud Gateway route configs. + * + * @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 Spring Cloud Gateway route configs along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the Spring Cloud Gateway route config. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GatewayRouteConfigResource resource. + * + * @param name resource name. + * @return the first stage of the new GatewayRouteConfigResource definition. + */ + GatewayRouteConfigResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Gateways.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Gateways.java new file mode 100644 index 0000000000000..bb6d3aebb48ca --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Gateways.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.Map; + +/** Resource collection API of Gateways. */ +public interface Gateways { + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 Spring Cloud Gateway and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Spring Cloud Gateway and its properties. + */ + GatewayResource get(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String gatewayName); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 serviceName, String gatewayName, Context context); + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 sensitive properties for Spring Cloud Gateway along with {@link Response}. + */ + Response> listEnvSecretsWithResponse( + String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * List sensitive environment variables of Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitive properties for Spring Cloud Gateway. + */ + Map listEnvSecrets(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 restart(String resourceGroupName, String serviceName, String gatewayName); + + /** + * Restart the Spring Cloud Gateway. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @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 restart(String resourceGroupName, String serviceName, String gatewayName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of gateway resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @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 validation result for custom domain along with {@link Response}. + */ + Response validateDomainWithResponse( + String resourceGroupName, + String serviceName, + String gatewayName, + CustomDomainValidatePayload validatePayload, + Context context); + + /** + * Check the domains are valid as well as not in use. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param gatewayName The name of Spring Cloud Gateway. + * @param validatePayload Custom domain payload to be validated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation result for custom domain. + */ + CustomDomainValidateResult validateDomain( + String resourceGroupName, String serviceName, String gatewayName, CustomDomainValidatePayload validatePayload); + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @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 Spring Cloud Gateway and its properties along with {@link Response}. + */ + GatewayResource getById(String id); + + /** + * Get the Spring Cloud Gateway and its properties. + * + * @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 Spring Cloud Gateway and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Disable the default Spring Cloud Gateway. + * + * @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); + + /** + * Disable the default Spring Cloud Gateway. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GatewayResource resource. + * + * @param name resource name. + * @return the first stage of the new GatewayResource definition. + */ + GatewayResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitImplementation.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitImplementation.java new file mode 100644 index 0000000000000..7385a30a462a9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitImplementation.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Git libraries used to support various repository providers. */ +public final class GitImplementation extends ExpandableStringEnum { + /** Static value go-git for GitImplementation. */ + public static final GitImplementation GO_GIT = fromString("go-git"); + + /** Static value libgit2 for GitImplementation. */ + public static final GitImplementation LIBGIT2 = fromString("libgit2"); + + /** + * Creates a new instance of GitImplementation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GitImplementation() { + } + + /** + * Creates or finds a GitImplementation from its string representation. + * + * @param name a name to look for. + * @return the corresponding GitImplementation. + */ + @JsonCreator + public static GitImplementation fromString(String name) { + return fromString(name, GitImplementation.class); + } + + /** + * Gets known GitImplementation values. + * + * @return known GitImplementation values. + */ + public static Collection values() { + return values(GitImplementation.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitPatternRepository.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitPatternRepository.java new file mode 100644 index 0000000000000..9318013bcb874 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitPatternRepository.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Git repository property payload for config server. */ +@Fluent +public final class GitPatternRepository { + /* + * Name of the repository + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Collection of pattern of the repository + */ + @JsonProperty(value = "pattern") + private List pattern; + + /* + * URI of the repository + */ + @JsonProperty(value = "uri", required = true) + private String uri; + + /* + * Label of the repository + */ + @JsonProperty(value = "label") + private String label; + + /* + * Searching path of the repository + */ + @JsonProperty(value = "searchPaths") + private List searchPaths; + + /* + * Username of git repository basic auth. + */ + @JsonProperty(value = "username") + private String username; + + /* + * Password of git repository basic auth. + */ + @JsonProperty(value = "password") + private String password; + + /* + * Public sshKey of git repository. + */ + @JsonProperty(value = "hostKey") + private String hostKey; + + /* + * SshKey algorithm of git repository. + */ + @JsonProperty(value = "hostKeyAlgorithm") + private String hostKeyAlgorithm; + + /* + * Private sshKey algorithm of git repository. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /* + * Strict host key checking or not. + */ + @JsonProperty(value = "strictHostKeyChecking") + private Boolean strictHostKeyChecking; + + /** Creates an instance of GitPatternRepository class. */ + public GitPatternRepository() { + } + + /** + * Get the name property: Name of the repository. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the repository. + * + * @param name the name value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withName(String name) { + this.name = name; + return this; + } + + /** + * Get the pattern property: Collection of pattern of the repository. + * + * @return the pattern value. + */ + public List pattern() { + return this.pattern; + } + + /** + * Set the pattern property: Collection of pattern of the repository. + * + * @param pattern the pattern value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPattern(List pattern) { + this.pattern = pattern; + return this; + } + + /** + * Get the uri property: URI of the repository. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Set the uri property: URI of the repository. + * + * @param uri the uri value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUri(String uri) { + this.uri = uri; + return this; + } + + /** + * Get the label property: Label of the repository. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: Label of the repository. + * + * @param label the label value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the searchPaths property: Searching path of the repository. + * + * @return the searchPaths value. + */ + public List searchPaths() { + return this.searchPaths; + } + + /** + * Set the searchPaths property: Searching path of the repository. + * + * @param searchPaths the searchPaths value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withSearchPaths(List searchPaths) { + this.searchPaths = searchPaths; + return this; + } + + /** + * Get the username property: Username of git repository basic auth. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Username of git repository basic auth. + * + * @param username the username value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: Password of git repository basic auth. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: Password of git repository basic auth. + * + * @param password the password value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPassword(String password) { + this.password = password; + return this; + } + + /** + * Get the hostKey property: Public sshKey of git repository. + * + * @return the hostKey value. + */ + public String hostKey() { + return this.hostKey; + } + + /** + * Set the hostKey property: Public sshKey of git repository. + * + * @param hostKey the hostKey value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKey(String hostKey) { + this.hostKey = hostKey; + return this; + } + + /** + * Get the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @return the hostKeyAlgorithm value. + */ + public String hostKeyAlgorithm() { + return this.hostKeyAlgorithm; + } + + /** + * Set the hostKeyAlgorithm property: SshKey algorithm of git repository. + * + * @param hostKeyAlgorithm the hostKeyAlgorithm value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withHostKeyAlgorithm(String hostKeyAlgorithm) { + this.hostKeyAlgorithm = hostKeyAlgorithm; + return this; + } + + /** + * Get the privateKey property: Private sshKey algorithm of git repository. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: Private sshKey algorithm of git repository. + * + * @param privateKey the privateKey value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get the strictHostKeyChecking property: Strict host key checking or not. + * + * @return the strictHostKeyChecking value. + */ + public Boolean strictHostKeyChecking() { + return this.strictHostKeyChecking; + } + + /** + * Set the strictHostKeyChecking property: Strict host key checking or not. + * + * @param strictHostKeyChecking the strictHostKeyChecking value to set. + * @return the GitPatternRepository object itself. + */ + public GitPatternRepository withStrictHostKeyChecking(Boolean strictHostKeyChecking) { + this.strictHostKeyChecking = strictHostKeyChecking; + 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 GitPatternRepository")); + } + if (uri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property uri in model GitPatternRepository")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GitPatternRepository.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GloballyEnabledApms.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GloballyEnabledApms.java new file mode 100644 index 0000000000000..8ce55b2c0d8fa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GloballyEnabledApms.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.GloballyEnabledApmsInner; +import java.util.List; + +/** An immutable client-side representation of GloballyEnabledApms. */ +public interface GloballyEnabledApms { + /** + * Gets the value property: Collection of the globally enabled APMs. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.GloballyEnabledApmsInner object. + * + * @return the inner object. + */ + GloballyEnabledApmsInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpGetAction.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpGetAction.java new file mode 100644 index 0000000000000..0100bb207452c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpGetAction.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** HTTPGetAction describes an action based on HTTP Get requests. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("HTTPGetAction") +@Fluent +public final class HttpGetAction extends ProbeAction { + /* + * Path to access on the HTTP server. + */ + @JsonProperty(value = "path") + private String path; + + /* + * Scheme to use for connecting to the host. Defaults to HTTP. + * + * Possible enum values: + * - `"HTTP"` means that the scheme used will be http:// + * - `"HTTPS"` means that the scheme used will be https:// + */ + @JsonProperty(value = "scheme") + private HttpSchemeType scheme; + + /** Creates an instance of HttpGetAction class. */ + public HttpGetAction() { + } + + /** + * Get the path property: Path to access on the HTTP server. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path to access on the HTTP server. + * + * @param path the path value to set. + * @return the HttpGetAction object itself. + */ + public HttpGetAction withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the scheme property: Scheme to use for connecting to the host. Defaults to HTTP. + * + *

Possible enum values: - `"HTTP"` means that the scheme used will be http:// - `"HTTPS"` means that the scheme + * used will be https://. + * + * @return the scheme value. + */ + public HttpSchemeType scheme() { + return this.scheme; + } + + /** + * Set the scheme property: Scheme to use for connecting to the host. Defaults to HTTP. + * + *

Possible enum values: - `"HTTP"` means that the scheme used will be http:// - `"HTTPS"` means that the scheme + * used will be https://. + * + * @param scheme the scheme value to set. + * @return the HttpGetAction object itself. + */ + public HttpGetAction withScheme(HttpSchemeType scheme) { + this.scheme = scheme; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpScaleRule.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpScaleRule.java new file mode 100644 index 0000000000000..5df91dd510dec --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpScaleRule.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Spring Apps App Instance Http scaling rule. */ +@Fluent +public final class HttpScaleRule { + /* + * Metadata properties to describe http scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the custom scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** Creates an instance of HttpScaleRule class. */ + public HttpScaleRule() { + } + + /** + * Get the metadata property: Metadata properties to describe http scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe http scale rule. + * + * @param metadata the metadata value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the custom scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the custom scale rule. + * + * @param auth the auth value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpSchemeType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpSchemeType.java new file mode 100644 index 0000000000000..aca310bc18717 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/HttpSchemeType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Scheme to use for connecting to the host. Defaults to HTTP. + * + *

Possible enum values: - `"HTTP"` means that the scheme used will be http:// - `"HTTPS"` means that the scheme used + * will be https://. + */ +public final class HttpSchemeType extends ExpandableStringEnum { + /** Static value HTTP for HttpSchemeType. */ + public static final HttpSchemeType HTTP = fromString("HTTP"); + + /** Static value HTTPS for HttpSchemeType. */ + public static final HttpSchemeType HTTPS = fromString("HTTPS"); + + /** + * Creates a new instance of HttpSchemeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HttpSchemeType() { + } + + /** + * Creates or finds a HttpSchemeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HttpSchemeType. + */ + @JsonCreator + public static HttpSchemeType fromString(String name) { + return fromString(name, HttpSchemeType.class); + } + + /** + * Gets known HttpSchemeType values. + * + * @return known HttpSchemeType values. + */ + public static Collection values() { + return values(HttpSchemeType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ImageRegistryCredential.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ImageRegistryCredential.java new file mode 100644 index 0000000000000..7312532197436 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ImageRegistryCredential.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Credential of the image registry. */ +@Fluent +public final class ImageRegistryCredential { + /* + * The username of the image registry credential + */ + @JsonProperty(value = "username") + private String username; + + /* + * The password of the image registry credential + */ + @JsonProperty(value = "password") + private String password; + + /** Creates an instance of ImageRegistryCredential class. */ + public ImageRegistryCredential() { + } + + /** + * Get the username property: The username of the image registry credential. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: The username of the image registry credential. + * + * @param username the username value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of the image registry credential. + * + * @return the password value. + */ + public String password() { + return this.password; + } + + /** + * Set the password property: The password of the image registry credential. + * + * @param password the password value to set. + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressConfig.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressConfig.java new file mode 100644 index 0000000000000..5d8ef0d7d5885 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressConfig.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ingress configuration payload for Azure Spring Apps resource. */ +@Fluent +public final class IngressConfig { + /* + * Ingress read time out in seconds. + */ + @JsonProperty(value = "readTimeoutInSeconds") + private Integer readTimeoutInSeconds; + + /** Creates an instance of IngressConfig class. */ + public IngressConfig() { + } + + /** + * Get the readTimeoutInSeconds property: Ingress read time out in seconds. + * + * @return the readTimeoutInSeconds value. + */ + public Integer readTimeoutInSeconds() { + return this.readTimeoutInSeconds; + } + + /** + * Set the readTimeoutInSeconds property: Ingress read time out in seconds. + * + * @param readTimeoutInSeconds the readTimeoutInSeconds value to set. + * @return the IngressConfig object itself. + */ + public IngressConfig withReadTimeoutInSeconds(Integer readTimeoutInSeconds) { + this.readTimeoutInSeconds = readTimeoutInSeconds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressSettings.java new file mode 100644 index 0000000000000..7674153ea22eb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressSettings.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** App ingress settings payload. */ +@Fluent +public final class IngressSettings { + /* + * Ingress read time out in seconds. + */ + @JsonProperty(value = "readTimeoutInSeconds") + private Integer readTimeoutInSeconds; + + /* + * Ingress send time out in seconds. + */ + @JsonProperty(value = "sendTimeoutInSeconds") + private Integer sendTimeoutInSeconds; + + /* + * Type of the affinity, set this to Cookie to enable session affinity. + */ + @JsonProperty(value = "sessionAffinity") + private SessionAffinity sessionAffinity; + + /* + * Time in seconds until the cookie expires. + */ + @JsonProperty(value = "sessionCookieMaxAge") + private Integer sessionCookieMaxAge; + + /* + * How ingress should communicate with this app backend service. + */ + @JsonProperty(value = "backendProtocol") + private BackendProtocol backendProtocol; + + /* + * Client-Certification Authentication. + */ + @JsonProperty(value = "clientAuth") + private IngressSettingsClientAuth clientAuth; + + /** Creates an instance of IngressSettings class. */ + public IngressSettings() { + } + + /** + * Get the readTimeoutInSeconds property: Ingress read time out in seconds. + * + * @return the readTimeoutInSeconds value. + */ + public Integer readTimeoutInSeconds() { + return this.readTimeoutInSeconds; + } + + /** + * Set the readTimeoutInSeconds property: Ingress read time out in seconds. + * + * @param readTimeoutInSeconds the readTimeoutInSeconds value to set. + * @return the IngressSettings object itself. + */ + public IngressSettings withReadTimeoutInSeconds(Integer readTimeoutInSeconds) { + this.readTimeoutInSeconds = readTimeoutInSeconds; + return this; + } + + /** + * Get the sendTimeoutInSeconds property: Ingress send time out in seconds. + * + * @return the sendTimeoutInSeconds value. + */ + public Integer sendTimeoutInSeconds() { + return this.sendTimeoutInSeconds; + } + + /** + * Set the sendTimeoutInSeconds property: Ingress send time out in seconds. + * + * @param sendTimeoutInSeconds the sendTimeoutInSeconds value to set. + * @return the IngressSettings object itself. + */ + public IngressSettings withSendTimeoutInSeconds(Integer sendTimeoutInSeconds) { + this.sendTimeoutInSeconds = sendTimeoutInSeconds; + return this; + } + + /** + * Get the sessionAffinity property: Type of the affinity, set this to Cookie to enable session affinity. + * + * @return the sessionAffinity value. + */ + public SessionAffinity sessionAffinity() { + return this.sessionAffinity; + } + + /** + * Set the sessionAffinity property: Type of the affinity, set this to Cookie to enable session affinity. + * + * @param sessionAffinity the sessionAffinity value to set. + * @return the IngressSettings object itself. + */ + public IngressSettings withSessionAffinity(SessionAffinity sessionAffinity) { + this.sessionAffinity = sessionAffinity; + return this; + } + + /** + * Get the sessionCookieMaxAge property: Time in seconds until the cookie expires. + * + * @return the sessionCookieMaxAge value. + */ + public Integer sessionCookieMaxAge() { + return this.sessionCookieMaxAge; + } + + /** + * Set the sessionCookieMaxAge property: Time in seconds until the cookie expires. + * + * @param sessionCookieMaxAge the sessionCookieMaxAge value to set. + * @return the IngressSettings object itself. + */ + public IngressSettings withSessionCookieMaxAge(Integer sessionCookieMaxAge) { + this.sessionCookieMaxAge = sessionCookieMaxAge; + return this; + } + + /** + * Get the backendProtocol property: How ingress should communicate with this app backend service. + * + * @return the backendProtocol value. + */ + public BackendProtocol backendProtocol() { + return this.backendProtocol; + } + + /** + * Set the backendProtocol property: How ingress should communicate with this app backend service. + * + * @param backendProtocol the backendProtocol value to set. + * @return the IngressSettings object itself. + */ + public IngressSettings withBackendProtocol(BackendProtocol backendProtocol) { + this.backendProtocol = backendProtocol; + return this; + } + + /** + * Get the clientAuth property: Client-Certification Authentication. + * + * @return the clientAuth value. + */ + public IngressSettingsClientAuth clientAuth() { + return this.clientAuth; + } + + /** + * Set the clientAuth property: Client-Certification Authentication. + * + * @param clientAuth the clientAuth value to set. + * @return the IngressSettings object itself. + */ + public IngressSettings withClientAuth(IngressSettingsClientAuth clientAuth) { + this.clientAuth = clientAuth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (clientAuth() != null) { + clientAuth().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressSettingsClientAuth.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressSettingsClientAuth.java new file mode 100644 index 0000000000000..f9d7388c0bb8a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/IngressSettingsClientAuth.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Client-Certification Authentication. */ +@Fluent +public final class IngressSettingsClientAuth { + /* + * Collection of certificate resource id. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /** Creates an instance of IngressSettingsClientAuth class. */ + public IngressSettingsClientAuth() { + } + + /** + * Get the certificates property: Collection of certificate resource id. + * + * @return the certificates value. + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates property: Collection of certificate resource id. + * + * @param certificates the certificates value to set. + * @return the IngressSettingsClientAuth object itself. + */ + public IngressSettingsClientAuth withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/JarUploadedUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/JarUploadedUserSourceInfo.java new file mode 100644 index 0000000000000..ff545c28ac30d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/JarUploadedUserSourceInfo.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Uploaded Jar binary for a deployment. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Jar") +@Fluent +public final class JarUploadedUserSourceInfo extends UploadedUserSourceInfo { + /* + * Runtime version of the Jar file + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /* + * JVM parameter + */ + @JsonProperty(value = "jvmOptions") + private String jvmOptions; + + /** Creates an instance of JarUploadedUserSourceInfo class. */ + public JarUploadedUserSourceInfo() { + } + + /** + * Get the runtimeVersion property: Runtime version of the Jar file. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime version of the Jar file. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the JarUploadedUserSourceInfo object itself. + */ + public JarUploadedUserSourceInfo withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Get the jvmOptions property: JVM parameter. + * + * @return the jvmOptions value. + */ + public String jvmOptions() { + return this.jvmOptions; + } + + /** + * Set the jvmOptions property: JVM parameter. + * + * @param jvmOptions the jvmOptions value to set. + * @return the JarUploadedUserSourceInfo object itself. + */ + public JarUploadedUserSourceInfo withJvmOptions(String jvmOptions) { + this.jvmOptions = jvmOptions; + return this; + } + + /** {@inheritDoc} */ + @Override + public JarUploadedUserSourceInfo withRelativePath(String relativePath) { + super.withRelativePath(relativePath); + return this; + } + + /** {@inheritDoc} */ + @Override + public JarUploadedUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KPackBuildStageProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KPackBuildStageProvisioningState.java new file mode 100644 index 0000000000000..f10c3d25a57a5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KPackBuildStageProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The provisioning state of this build stage resource. */ +public final class KPackBuildStageProvisioningState extends ExpandableStringEnum { + /** Static value NotStarted for KPackBuildStageProvisioningState. */ + public static final KPackBuildStageProvisioningState NOT_STARTED = fromString("NotStarted"); + + /** Static value Running for KPackBuildStageProvisioningState. */ + public static final KPackBuildStageProvisioningState RUNNING = fromString("Running"); + + /** Static value Succeeded for KPackBuildStageProvisioningState. */ + public static final KPackBuildStageProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for KPackBuildStageProvisioningState. */ + public static final KPackBuildStageProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of KPackBuildStageProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KPackBuildStageProvisioningState() { + } + + /** + * Creates or finds a KPackBuildStageProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding KPackBuildStageProvisioningState. + */ + @JsonCreator + public static KPackBuildStageProvisioningState fromString(String name) { + return fromString(name, KPackBuildStageProvisioningState.class); + } + + /** + * Gets known KPackBuildStageProvisioningState values. + * + * @return known KPackBuildStageProvisioningState values. + */ + public static Collection values() { + return values(KPackBuildStageProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateAutoSync.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateAutoSync.java new file mode 100644 index 0000000000000..48af97c43bb11 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateAutoSync.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Indicates whether to automatically synchronize certificate from key vault or not. */ +public final class KeyVaultCertificateAutoSync extends ExpandableStringEnum { + /** Static value Disabled for KeyVaultCertificateAutoSync. */ + public static final KeyVaultCertificateAutoSync DISABLED = fromString("Disabled"); + + /** Static value Enabled for KeyVaultCertificateAutoSync. */ + public static final KeyVaultCertificateAutoSync ENABLED = fromString("Enabled"); + + /** + * Creates a new instance of KeyVaultCertificateAutoSync value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public KeyVaultCertificateAutoSync() { + } + + /** + * Creates or finds a KeyVaultCertificateAutoSync from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyVaultCertificateAutoSync. + */ + @JsonCreator + public static KeyVaultCertificateAutoSync fromString(String name) { + return fromString(name, KeyVaultCertificateAutoSync.class); + } + + /** + * Gets known KeyVaultCertificateAutoSync values. + * + * @return known KeyVaultCertificateAutoSync values. + */ + public static Collection values() { + return values(KeyVaultCertificateAutoSync.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateProperties.java new file mode 100644 index 0000000000000..373580e9e79ec --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of certificate imported from key vault. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("KeyVaultCertificate") +@Fluent +public final class KeyVaultCertificateProperties extends CertificateProperties { + /* + * The vault uri of user key vault. + */ + @JsonProperty(value = "vaultUri", required = true) + private String vaultUri; + + /* + * The certificate name of key vault. + */ + @JsonProperty(value = "keyVaultCertName", required = true) + private String keyVaultCertName; + + /* + * The certificate version of key vault. + */ + @JsonProperty(value = "certVersion") + private String certVersion; + + /* + * Optional. If set to true, it will not import private key from key vault. + */ + @JsonProperty(value = "excludePrivateKey") + private Boolean excludePrivateKey; + + /* + * Indicates whether to automatically synchronize certificate from key vault or not. + */ + @JsonProperty(value = "autoSync") + private KeyVaultCertificateAutoSync autoSync; + + /** Creates an instance of KeyVaultCertificateProperties class. */ + public KeyVaultCertificateProperties() { + } + + /** + * Get the vaultUri property: The vault uri of user key vault. + * + * @return the vaultUri value. + */ + public String vaultUri() { + return this.vaultUri; + } + + /** + * Set the vaultUri property: The vault uri of user key vault. + * + * @param vaultUri the vaultUri value to set. + * @return the KeyVaultCertificateProperties object itself. + */ + public KeyVaultCertificateProperties withVaultUri(String vaultUri) { + this.vaultUri = vaultUri; + return this; + } + + /** + * Get the keyVaultCertName property: The certificate name of key vault. + * + * @return the keyVaultCertName value. + */ + public String keyVaultCertName() { + return this.keyVaultCertName; + } + + /** + * Set the keyVaultCertName property: The certificate name of key vault. + * + * @param keyVaultCertName the keyVaultCertName value to set. + * @return the KeyVaultCertificateProperties object itself. + */ + public KeyVaultCertificateProperties withKeyVaultCertName(String keyVaultCertName) { + this.keyVaultCertName = keyVaultCertName; + return this; + } + + /** + * Get the certVersion property: The certificate version of key vault. + * + * @return the certVersion value. + */ + public String certVersion() { + return this.certVersion; + } + + /** + * Set the certVersion property: The certificate version of key vault. + * + * @param certVersion the certVersion value to set. + * @return the KeyVaultCertificateProperties object itself. + */ + public KeyVaultCertificateProperties withCertVersion(String certVersion) { + this.certVersion = certVersion; + return this; + } + + /** + * Get the excludePrivateKey property: Optional. If set to true, it will not import private key from key vault. + * + * @return the excludePrivateKey value. + */ + public Boolean excludePrivateKey() { + return this.excludePrivateKey; + } + + /** + * Set the excludePrivateKey property: Optional. If set to true, it will not import private key from key vault. + * + * @param excludePrivateKey the excludePrivateKey value to set. + * @return the KeyVaultCertificateProperties object itself. + */ + public KeyVaultCertificateProperties withExcludePrivateKey(Boolean excludePrivateKey) { + this.excludePrivateKey = excludePrivateKey; + return this; + } + + /** + * Get the autoSync property: Indicates whether to automatically synchronize certificate from key vault or not. + * + * @return the autoSync value. + */ + public KeyVaultCertificateAutoSync autoSync() { + return this.autoSync; + } + + /** + * Set the autoSync property: Indicates whether to automatically synchronize certificate from key vault or not. + * + * @param autoSync the autoSync value to set. + * @return the KeyVaultCertificateProperties object itself. + */ + public KeyVaultCertificateProperties withAutoSync(KeyVaultCertificateAutoSync autoSync) { + this.autoSync = autoSync; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (vaultUri() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vaultUri in model KeyVaultCertificateProperties")); + } + if (keyVaultCertName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyVaultCertName in model KeyVaultCertificateProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(KeyVaultCertificateProperties.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LoadedCertificate.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LoadedCertificate.java new file mode 100644 index 0000000000000..8d5914eabc39a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LoadedCertificate.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Loaded certificate payload. */ +@Fluent +public final class LoadedCertificate { + /* + * Resource Id of loaded certificate + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /* + * Indicate whether the certificate will be loaded into default trust store, only work for Java runtime. + */ + @JsonProperty(value = "loadTrustStore") + private Boolean loadTrustStore; + + /** Creates an instance of LoadedCertificate class. */ + public LoadedCertificate() { + } + + /** + * Get the resourceId property: Resource Id of loaded certificate. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: Resource Id of loaded certificate. + * + * @param resourceId the resourceId value to set. + * @return the LoadedCertificate object itself. + */ + public LoadedCertificate withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the loadTrustStore property: Indicate whether the certificate will be loaded into default trust store, only + * work for Java runtime. + * + * @return the loadTrustStore value. + */ + public Boolean loadTrustStore() { + return this.loadTrustStore; + } + + /** + * Set the loadTrustStore property: Indicate whether the certificate will be loaded into default trust store, only + * work for Java runtime. + * + * @param loadTrustStore the loadTrustStore value to set. + * @return the LoadedCertificate object itself. + */ + public LoadedCertificate withLoadTrustStore(Boolean loadTrustStore) { + this.loadTrustStore = loadTrustStore; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property resourceId in model LoadedCertificate")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(LoadedCertificate.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LogFileUrlResponse.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LogFileUrlResponse.java new file mode 100644 index 0000000000000..204de9d4e692c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LogFileUrlResponse.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.LogFileUrlResponseInner; + +/** An immutable client-side representation of LogFileUrlResponse. */ +public interface LogFileUrlResponse { + /** + * Gets the url property: URL of the log file. + * + * @return the url value. + */ + String url(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.LogFileUrlResponseInner object. + * + * @return the inner object. + */ + LogFileUrlResponseInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LogSpecification.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LogSpecification.java new file mode 100644 index 0000000000000..6f6a6d03d9fc6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LogSpecification.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Log for Azure Monitoring. */ +@Fluent +public final class LogSpecification { + /* + * Name of the log + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the log + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Blob duration of the log + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /** Creates an instance of LogSpecification class. */ + public LogSpecification() { + } + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Blob duration of the log. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Blob duration of the log. + * + * @param blobDuration the blobDuration value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MaintenanceScheduleConfiguration.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MaintenanceScheduleConfiguration.java new file mode 100644 index 0000000000000..ce316330cdd99 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MaintenanceScheduleConfiguration.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Configuration for the planned maintenance. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "frequency", + defaultImpl = MaintenanceScheduleConfiguration.class) +@JsonTypeName("MaintenanceScheduleConfiguration") +@JsonSubTypes({@JsonSubTypes.Type(name = "Weekly", value = WeeklyMaintenanceScheduleConfiguration.class)}) +@Immutable +public class MaintenanceScheduleConfiguration { + /** Creates an instance of MaintenanceScheduleConfiguration class. */ + public MaintenanceScheduleConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityProperties.java new file mode 100644 index 0000000000000..2ac7a0a8dd978 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed identity properties retrieved from ARM request headers. */ +@Fluent +public final class ManagedIdentityProperties { + /* + * Type of the managed identity + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * Principal Id of system-assigned managed identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * Tenant Id of system-assigned managed identity. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Properties of user-assigned managed identities + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of ManagedIdentityProperties class. */ + public ManagedIdentityProperties() { + } + + /** + * Get the type property: Type of the managed identity. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of the managed identity. + * + * @param type the type value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the principalId property: Principal Id of system-assigned managed identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Principal Id of system-assigned managed identity. + * + * @param principalId the principalId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: Tenant Id of system-assigned managed identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id of system-assigned managed identity. + * + * @param tenantId the tenantId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the userAssignedIdentities property: Properties of user-assigned managed identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Properties of user-assigned managed identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityType.java new file mode 100644 index 0000000000000..a8d22eb4fc501 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the managed identity. */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedIdentityType. */ + public static final ManagedIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** Static value SystemAssigned,UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedIdentityType() { + } + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** + * Gets known ManagedIdentityType values. + * + * @return known ManagedIdentityType values. + */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MarketplaceResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MarketplaceResource.java new file mode 100644 index 0000000000000..39f954451463f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MarketplaceResource.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Purchasing 3rd Party product for one Azure Spring Apps instance. */ +@Fluent +public final class MarketplaceResource { + /* + * The plan id of the 3rd Party Artifact that is being procured. + */ + @JsonProperty(value = "plan") + private String plan; + + /* + * The publisher id of the 3rd Party Artifact that is being bought. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * The 3rd Party artifact that is being procured. + */ + @JsonProperty(value = "product") + private String product; + + /** Creates an instance of MarketplaceResource class. */ + public MarketplaceResource() { + } + + /** + * Get the plan property: The plan id of the 3rd Party Artifact that is being procured. + * + * @return the plan value. + */ + public String plan() { + return this.plan; + } + + /** + * Set the plan property: The plan id of the 3rd Party Artifact that is being procured. + * + * @param plan the plan value to set. + * @return the MarketplaceResource object itself. + */ + public MarketplaceResource withPlan(String plan) { + this.plan = plan; + return this; + } + + /** + * Get the publisher property: The publisher id of the 3rd Party Artifact that is being bought. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The publisher id of the 3rd Party Artifact that is being bought. + * + * @param publisher the publisher value to set. + * @return the MarketplaceResource object itself. + */ + public MarketplaceResource withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: The 3rd Party artifact that is being procured. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: The 3rd Party artifact that is being procured. + * + * @param product the product value to set. + * @return the MarketplaceResource object itself. + */ + public MarketplaceResource withProduct(String product) { + this.product = product; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricDimension.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricDimension.java new file mode 100644 index 0000000000000..0dbead06c1a89 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricDimension.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Dimension of metrics. */ +@Fluent +public final class MetricDimension { + /* + * Name of the dimension + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the dimension + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Whether this dimension should be included for the Shoebox export scenario + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** Creates an instance of MetricDimension class. */ + public MetricDimension() { + } + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the dimension. + * + * @param name the name value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: Whether this dimension should be included for the Shoebox export + * scenario. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: Whether this dimension should be included for the Shoebox export + * scenario. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the MetricDimension object itself. + */ + public MetricDimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricSpecification.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricSpecification.java new file mode 100644 index 0000000000000..4db8b4d23e458 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricSpecification.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifications of the Metrics for Azure Monitoring. */ +@Fluent +public final class MetricSpecification { + /* + * Name of the metric + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the metric + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localized friendly description of the metric + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * Unit that makes sense for the metric + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Name of the metric category that the metric belongs to. A metric can only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Supported aggregation types + */ + @JsonProperty(value = "supportedAggregationTypes") + private List supportedAggregationTypes; + + /* + * Supported time grain types + */ + @JsonProperty(value = "supportedTimeGrainTypes") + private List supportedTimeGrainTypes; + + /* + * Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + */ + @JsonProperty(value = "fillGapWithZero") + private Boolean fillGapWithZero; + + /* + * Dimensions of the metric + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Name of the MDM namespace. Optional. + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /** Creates an instance of MetricSpecification class. */ + public MetricSpecification() { + } + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: Unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Unit that makes sense for the metric. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: Name of the metric category that the metric belongs to. A metric can only belong to a + * single category. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the supportedAggregationTypes property: Supported aggregation types. + * + * @return the supportedAggregationTypes value. + */ + public List supportedAggregationTypes() { + return this.supportedAggregationTypes; + } + + /** + * Set the supportedAggregationTypes property: Supported aggregation types. + * + * @param supportedAggregationTypes the supportedAggregationTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedAggregationTypes(List supportedAggregationTypes) { + this.supportedAggregationTypes = supportedAggregationTypes; + return this; + } + + /** + * Get the supportedTimeGrainTypes property: Supported time grain types. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Set the supportedTimeGrainTypes property: Supported time grain types. + * + * @param supportedTimeGrainTypes the supportedTimeGrainTypes value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSupportedTimeGrainTypes(List supportedTimeGrainTypes) { + this.supportedTimeGrainTypes = supportedTimeGrainTypes; + return this; + } + + /** + * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @return the fillGapWithZero value. + */ + public Boolean fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(Boolean fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the dimensions property: Dimensions of the metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Dimensions of the metric. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the sourceMdmNamespace property: Name of the MDM namespace. Optional. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: Name of the MDM namespace. Optional. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingProperties.java new file mode 100644 index 0000000000000..73897c2611a18 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingProperties.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monitoring Setting properties payload. */ +@Fluent +public final class MonitoringSettingProperties { + /* + * State of the Monitoring Setting. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private MonitoringSettingState provisioningState; + + /* + * Error when apply Monitoring Setting changes. + */ + @JsonProperty(value = "error") + private Error error; + + /* + * Indicates whether enable the trace functionality, which will be deprecated since api version 2020-11-01-preview. + * Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings enabled or not + */ + @JsonProperty(value = "traceEnabled") + private Boolean traceEnabled; + + /* + * Target application insight instrumentation key, null or whitespace include empty will disable monitoringSettings + */ + @JsonProperty(value = "appInsightsInstrumentationKey") + private String appInsightsInstrumentationKey; + + /* + * Indicates the sampling rate of application insight agent, should be in range [0.0, 100.0] + */ + @JsonProperty(value = "appInsightsSamplingRate") + private Double appInsightsSamplingRate; + + /* + * Indicates the versions of application insight agent + */ + @JsonProperty(value = "appInsightsAgentVersions") + private ApplicationInsightsAgentVersions appInsightsAgentVersions; + + /** Creates an instance of MonitoringSettingProperties class. */ + public MonitoringSettingProperties() { + } + + /** + * Get the provisioningState property: State of the Monitoring Setting. + * + * @return the provisioningState value. + */ + public MonitoringSettingState provisioningState() { + return this.provisioningState; + } + + /** + * Get the error property: Error when apply Monitoring Setting changes. + * + * @return the error value. + */ + public Error error() { + return this.error; + } + + /** + * Set the error property: Error when apply Monitoring Setting changes. + * + * @param error the error value to set. + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withError(Error error) { + this.error = error; + return this; + } + + /** + * Get the traceEnabled property: Indicates whether enable the trace functionality, which will be deprecated since + * api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings + * enabled or not. + * + * @return the traceEnabled value. + */ + public Boolean traceEnabled() { + return this.traceEnabled; + } + + /** + * Set the traceEnabled property: Indicates whether enable the trace functionality, which will be deprecated since + * api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings + * enabled or not. + * + * @param traceEnabled the traceEnabled value to set. + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withTraceEnabled(Boolean traceEnabled) { + this.traceEnabled = traceEnabled; + return this; + } + + /** + * Get the appInsightsInstrumentationKey property: Target application insight instrumentation key, null or + * whitespace include empty will disable monitoringSettings. + * + * @return the appInsightsInstrumentationKey value. + */ + public String appInsightsInstrumentationKey() { + return this.appInsightsInstrumentationKey; + } + + /** + * Set the appInsightsInstrumentationKey property: Target application insight instrumentation key, null or + * whitespace include empty will disable monitoringSettings. + * + * @param appInsightsInstrumentationKey the appInsightsInstrumentationKey value to set. + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withAppInsightsInstrumentationKey(String appInsightsInstrumentationKey) { + this.appInsightsInstrumentationKey = appInsightsInstrumentationKey; + return this; + } + + /** + * Get the appInsightsSamplingRate property: Indicates the sampling rate of application insight agent, should be in + * range [0.0, 100.0]. + * + * @return the appInsightsSamplingRate value. + */ + public Double appInsightsSamplingRate() { + return this.appInsightsSamplingRate; + } + + /** + * Set the appInsightsSamplingRate property: Indicates the sampling rate of application insight agent, should be in + * range [0.0, 100.0]. + * + * @param appInsightsSamplingRate the appInsightsSamplingRate value to set. + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withAppInsightsSamplingRate(Double appInsightsSamplingRate) { + this.appInsightsSamplingRate = appInsightsSamplingRate; + return this; + } + + /** + * Get the appInsightsAgentVersions property: Indicates the versions of application insight agent. + * + * @return the appInsightsAgentVersions value. + */ + public ApplicationInsightsAgentVersions appInsightsAgentVersions() { + return this.appInsightsAgentVersions; + } + + /** + * Set the appInsightsAgentVersions property: Indicates the versions of application insight agent. + * + * @param appInsightsAgentVersions the appInsightsAgentVersions value to set. + * @return the MonitoringSettingProperties object itself. + */ + public MonitoringSettingProperties withAppInsightsAgentVersions( + ApplicationInsightsAgentVersions appInsightsAgentVersions) { + this.appInsightsAgentVersions = appInsightsAgentVersions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + if (appInsightsAgentVersions() != null) { + appInsightsAgentVersions().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingResource.java new file mode 100644 index 0000000000000..3888717bcdaa2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; + +/** An immutable client-side representation of MonitoringSettingResource. */ +public interface MonitoringSettingResource { + /** + * 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 properties property: Properties of the Monitoring Setting resource. + * + * @return the properties value. + */ + MonitoringSettingProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner + * object. + * + * @return the inner object. + */ + MonitoringSettingResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingState.java new file mode 100644 index 0000000000000..8ca5ac5064bc5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Monitoring Setting. */ +public final class MonitoringSettingState extends ExpandableStringEnum { + /** Static value NotAvailable for MonitoringSettingState. */ + public static final MonitoringSettingState NOT_AVAILABLE = fromString("NotAvailable"); + + /** Static value Failed for MonitoringSettingState. */ + public static final MonitoringSettingState FAILED = fromString("Failed"); + + /** Static value Succeeded for MonitoringSettingState. */ + public static final MonitoringSettingState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for MonitoringSettingState. */ + public static final MonitoringSettingState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of MonitoringSettingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public MonitoringSettingState() { + } + + /** + * Creates or finds a MonitoringSettingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding MonitoringSettingState. + */ + @JsonCreator + public static MonitoringSettingState fromString(String name) { + return fromString(name, MonitoringSettingState.class); + } + + /** + * Gets known MonitoringSettingState values. + * + * @return known MonitoringSettingState values. + */ + public static Collection values() { + return values(MonitoringSettingState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettings.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettings.java new file mode 100644 index 0000000000000..d336eb902c45f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettings.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; + +/** Resource collection API of MonitoringSettings. */ +public interface MonitoringSettings { + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Get the Monitoring Setting and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Monitoring Setting and its properties. + */ + MonitoringSettingResource get(String resourceGroupName, String serviceName); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update 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 monitoring Setting resource. + */ + MonitoringSettingResource updatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + MonitoringSettingResource updatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update 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 monitoring Setting resource. + */ + MonitoringSettingResource updatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource); + + /** + * Update the Monitoring Setting. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param monitoringSettingResource Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring Setting resource. + */ + MonitoringSettingResource updatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailability.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailability.java new file mode 100644 index 0000000000000..7cc6a4e3d03a0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailability.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.NameAvailabilityInner; + +/** An immutable client-side representation of NameAvailability. */ +public interface NameAvailability { + /** + * Gets the nameAvailable property: Indicates whether the name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: Reason why the name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: Message why the name is not available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.NameAvailabilityInner object. + * + * @return the inner object. + */ + NameAvailabilityInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailabilityParameters.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailabilityParameters.java new file mode 100644 index 0000000000000..21d6828e3e2b8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailabilityParameters.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name availability parameters payload. */ +@Fluent +public final class NameAvailabilityParameters { + /* + * Type of the resource to check name availability + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * Name to be checked + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** Creates an instance of NameAvailabilityParameters class. */ + public NameAvailabilityParameters() { + } + + /** + * Get the type property: Type of the resource to check name availability. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the resource to check name availability. + * + * @param type the type value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: Name to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name to be checked. + * + * @param name the name value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + 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 NameAvailabilityParameters")); + } + if (name() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model NameAvailabilityParameters")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NameAvailabilityParameters.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetCoreZipUploadedUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetCoreZipUploadedUserSourceInfo.java new file mode 100644 index 0000000000000..ea3fd546c387d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetCoreZipUploadedUserSourceInfo.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Uploaded Jar binary for a deployment. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("NetCoreZip") +@Fluent +public final class NetCoreZipUploadedUserSourceInfo extends UploadedUserSourceInfo { + /* + * The path to the .NET executable relative to zip root + */ + @JsonProperty(value = "netCoreMainEntryPath") + private String netCoreMainEntryPath; + + /* + * Runtime version of the .Net file + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /** Creates an instance of NetCoreZipUploadedUserSourceInfo class. */ + public NetCoreZipUploadedUserSourceInfo() { + } + + /** + * Get the netCoreMainEntryPath property: The path to the .NET executable relative to zip root. + * + * @return the netCoreMainEntryPath value. + */ + public String netCoreMainEntryPath() { + return this.netCoreMainEntryPath; + } + + /** + * Set the netCoreMainEntryPath property: The path to the .NET executable relative to zip root. + * + * @param netCoreMainEntryPath the netCoreMainEntryPath value to set. + * @return the NetCoreZipUploadedUserSourceInfo object itself. + */ + public NetCoreZipUploadedUserSourceInfo withNetCoreMainEntryPath(String netCoreMainEntryPath) { + this.netCoreMainEntryPath = netCoreMainEntryPath; + return this; + } + + /** + * Get the runtimeVersion property: Runtime version of the .Net file. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime version of the .Net file. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the NetCoreZipUploadedUserSourceInfo object itself. + */ + public NetCoreZipUploadedUserSourceInfo withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** {@inheritDoc} */ + @Override + public NetCoreZipUploadedUserSourceInfo withRelativePath(String relativePath) { + super.withRelativePath(relativePath); + return this; + } + + /** {@inheritDoc} */ + @Override + public NetCoreZipUploadedUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfile.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfile.java new file mode 100644 index 0000000000000..bd8ad38d8df7c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfile.java @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service network profile payload. */ +@Fluent +public final class NetworkProfile { + /* + * Fully qualified resource Id of the subnet to host Azure Spring Apps Service Runtime + */ + @JsonProperty(value = "serviceRuntimeSubnetId") + private String serviceRuntimeSubnetId; + + /* + * Fully qualified resource Id of the subnet to host customer apps in Azure Spring Apps + */ + @JsonProperty(value = "appSubnetId") + private String appSubnetId; + + /* + * Azure Spring Apps service reserved CIDR + */ + @JsonProperty(value = "serviceCidr") + private String serviceCidr; + + /* + * Name of the resource group containing network resources of Azure Spring Apps Service Runtime + */ + @JsonProperty(value = "serviceRuntimeNetworkResourceGroup") + private String serviceRuntimeNetworkResourceGroup; + + /* + * Name of the resource group containing network resources for customer apps in Azure Spring Apps + */ + @JsonProperty(value = "appNetworkResourceGroup") + private String appNetworkResourceGroup; + + /* + * Desired outbound IP resources for Azure Spring Apps resource. + */ + @JsonProperty(value = "outboundIPs", access = JsonProperty.Access.WRITE_ONLY) + private NetworkProfileOutboundIPs outboundIPs; + + /* + * Required inbound or outbound traffics for Azure Spring Apps resource. + */ + @JsonProperty(value = "requiredTraffics", access = JsonProperty.Access.WRITE_ONLY) + private List requiredTraffics; + + /* + * Ingress configuration payload for Azure Spring Apps resource. + */ + @JsonProperty(value = "ingressConfig") + private IngressConfig ingressConfig; + + /* + * The egress traffic type of Azure Spring Apps VNet instances. + */ + @JsonProperty(value = "outboundType") + private String outboundType; + + /** Creates an instance of NetworkProfile class. */ + public NetworkProfile() { + } + + /** + * Get the serviceRuntimeSubnetId property: Fully qualified resource Id of the subnet to host Azure Spring Apps + * Service Runtime. + * + * @return the serviceRuntimeSubnetId value. + */ + public String serviceRuntimeSubnetId() { + return this.serviceRuntimeSubnetId; + } + + /** + * Set the serviceRuntimeSubnetId property: Fully qualified resource Id of the subnet to host Azure Spring Apps + * Service Runtime. + * + * @param serviceRuntimeSubnetId the serviceRuntimeSubnetId value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withServiceRuntimeSubnetId(String serviceRuntimeSubnetId) { + this.serviceRuntimeSubnetId = serviceRuntimeSubnetId; + return this; + } + + /** + * Get the appSubnetId property: Fully qualified resource Id of the subnet to host customer apps in Azure Spring + * Apps. + * + * @return the appSubnetId value. + */ + public String appSubnetId() { + return this.appSubnetId; + } + + /** + * Set the appSubnetId property: Fully qualified resource Id of the subnet to host customer apps in Azure Spring + * Apps. + * + * @param appSubnetId the appSubnetId value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withAppSubnetId(String appSubnetId) { + this.appSubnetId = appSubnetId; + return this; + } + + /** + * Get the serviceCidr property: Azure Spring Apps service reserved CIDR. + * + * @return the serviceCidr value. + */ + public String serviceCidr() { + return this.serviceCidr; + } + + /** + * Set the serviceCidr property: Azure Spring Apps service reserved CIDR. + * + * @param serviceCidr the serviceCidr value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withServiceCidr(String serviceCidr) { + this.serviceCidr = serviceCidr; + return this; + } + + /** + * Get the serviceRuntimeNetworkResourceGroup property: Name of the resource group containing network resources of + * Azure Spring Apps Service Runtime. + * + * @return the serviceRuntimeNetworkResourceGroup value. + */ + public String serviceRuntimeNetworkResourceGroup() { + return this.serviceRuntimeNetworkResourceGroup; + } + + /** + * Set the serviceRuntimeNetworkResourceGroup property: Name of the resource group containing network resources of + * Azure Spring Apps Service Runtime. + * + * @param serviceRuntimeNetworkResourceGroup the serviceRuntimeNetworkResourceGroup value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withServiceRuntimeNetworkResourceGroup(String serviceRuntimeNetworkResourceGroup) { + this.serviceRuntimeNetworkResourceGroup = serviceRuntimeNetworkResourceGroup; + return this; + } + + /** + * Get the appNetworkResourceGroup property: Name of the resource group containing network resources for customer + * apps in Azure Spring Apps. + * + * @return the appNetworkResourceGroup value. + */ + public String appNetworkResourceGroup() { + return this.appNetworkResourceGroup; + } + + /** + * Set the appNetworkResourceGroup property: Name of the resource group containing network resources for customer + * apps in Azure Spring Apps. + * + * @param appNetworkResourceGroup the appNetworkResourceGroup value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withAppNetworkResourceGroup(String appNetworkResourceGroup) { + this.appNetworkResourceGroup = appNetworkResourceGroup; + return this; + } + + /** + * Get the outboundIPs property: Desired outbound IP resources for Azure Spring Apps resource. + * + * @return the outboundIPs value. + */ + public NetworkProfileOutboundIPs outboundIPs() { + return this.outboundIPs; + } + + /** + * Get the requiredTraffics property: Required inbound or outbound traffics for Azure Spring Apps resource. + * + * @return the requiredTraffics value. + */ + public List requiredTraffics() { + return this.requiredTraffics; + } + + /** + * Get the ingressConfig property: Ingress configuration payload for Azure Spring Apps resource. + * + * @return the ingressConfig value. + */ + public IngressConfig ingressConfig() { + return this.ingressConfig; + } + + /** + * Set the ingressConfig property: Ingress configuration payload for Azure Spring Apps resource. + * + * @param ingressConfig the ingressConfig value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withIngressConfig(IngressConfig ingressConfig) { + this.ingressConfig = ingressConfig; + return this; + } + + /** + * Get the outboundType property: The egress traffic type of Azure Spring Apps VNet instances. + * + * @return the outboundType value. + */ + public String outboundType() { + return this.outboundType; + } + + /** + * Set the outboundType property: The egress traffic type of Azure Spring Apps VNet instances. + * + * @param outboundType the outboundType value to set. + * @return the NetworkProfile object itself. + */ + public NetworkProfile withOutboundType(String outboundType) { + this.outboundType = outboundType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (outboundIPs() != null) { + outboundIPs().validate(); + } + if (requiredTraffics() != null) { + requiredTraffics().forEach(e -> e.validate()); + } + if (ingressConfig() != null) { + ingressConfig().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfileOutboundIPs.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfileOutboundIPs.java new file mode 100644 index 0000000000000..efdaa56706cee --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfileOutboundIPs.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Desired outbound IP resources for Azure Spring Apps resource. */ +@Immutable +public final class NetworkProfileOutboundIPs { + /* + * A list of public IP addresses. + */ + @JsonProperty(value = "publicIPs", access = JsonProperty.Access.WRITE_ONLY) + private List publicIPs; + + /** Creates an instance of NetworkProfileOutboundIPs class. */ + public NetworkProfileOutboundIPs() { + } + + /** + * Get the publicIPs property: A list of public IP addresses. + * + * @return the publicIPs value. + */ + public List publicIPs() { + return this.publicIPs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationDetail.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationDetail.java new file mode 100644 index 0000000000000..f2244748e1dd0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationDetail.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner; + +/** An immutable client-side representation of OperationDetail. */ +public interface OperationDetail { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * 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 origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Properties of the operation. + * + * @return the properties value. + */ + OperationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner object. + * + * @return the inner object. + */ + OperationDetailInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationDisplay.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationDisplay.java new file mode 100644 index 0000000000000..e62f81f914a69 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationDisplay.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Fluent +public final class OperationDisplay { + /* + * Resource provider of the operation + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource of the operation + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description") + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Resource provider of the operation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource of the operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationProperties.java new file mode 100644 index 0000000000000..d22703061935d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/OperationProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extra Operation properties. */ +@Fluent +public final class OperationProperties { + /* + * Service specifications of the operation + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** Creates an instance of OperationProperties class. */ + public OperationProperties() { + } + + /** + * Get the serviceSpecification property: Service specifications of the operation. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Service specifications of the operation. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Operations.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Operations.java new file mode 100644 index 0000000000000..f89ae773b5147 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.AppPlatform provider. + * + * @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 available operations of the service as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PersistentDisk.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PersistentDisk.java new file mode 100644 index 0000000000000..a370912c45546 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PersistentDisk.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Persistent disk payload. */ +@Fluent +public final class PersistentDisk { + /* + * Size of the persistent disk in GB + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /* + * Size of the used persistent disk in GB + */ + @JsonProperty(value = "usedInGB", access = JsonProperty.Access.WRITE_ONLY) + private Integer usedInGB; + + /* + * Mount path of the persistent disk + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** Creates an instance of PersistentDisk class. */ + public PersistentDisk() { + } + + /** + * Get the sizeInGB property: Size of the persistent disk in GB. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Size of the persistent disk in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the PersistentDisk object itself. + */ + public PersistentDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get the usedInGB property: Size of the used persistent disk in GB. + * + * @return the usedInGB value. + */ + public Integer usedInGB() { + return this.usedInGB; + } + + /** + * Get the mountPath property: Mount path of the persistent disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Mount path of the persistent disk. + * + * @param mountPath the mountPath value to set. + * @return the PersistentDisk object itself. + */ + public PersistentDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PowerState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PowerState.java new file mode 100644 index 0000000000000..4758b5d04fb04 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PowerState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Power state of the Service. */ +public final class PowerState extends ExpandableStringEnum { + /** Static value Running for PowerState. */ + public static final PowerState RUNNING = fromString("Running"); + + /** Static value Stopped for PowerState. */ + public static final PowerState STOPPED = fromString("Stopped"); + + /** + * Creates a new instance of PowerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PowerState() { + } + + /** + * Creates or finds a PowerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PowerState. + */ + @JsonCreator + public static PowerState fromString(String name) { + return fromString(name, PowerState.class); + } + + /** + * Gets known PowerState values. + * + * @return known PowerState values. + */ + public static Collection values() { + return values(PowerState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorProperties.java new file mode 100644 index 0000000000000..a9368ff2a17fe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Predefined accelerator properties payload. */ +@Fluent +public final class PredefinedAcceleratorProperties { + /* + * Provisioning state of the predefined accelerator. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PredefinedAcceleratorProvisioningState provisioningState; + + /* + * The displayName property. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The description property. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The iconUrl property. + */ + @JsonProperty(value = "iconUrl", access = JsonProperty.Access.WRITE_ONLY) + private String iconUrl; + + /* + * The acceleratorTags property. + */ + @JsonProperty(value = "acceleratorTags", access = JsonProperty.Access.WRITE_ONLY) + private List acceleratorTags; + + /* + * State of the predefined accelerator. + */ + @JsonProperty(value = "state") + private PredefinedAcceleratorState state; + + /** Creates an instance of PredefinedAcceleratorProperties class. */ + public PredefinedAcceleratorProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the predefined accelerator. + * + * @return the provisioningState value. + */ + public PredefinedAcceleratorProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the displayName property: The displayName property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: The description property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the iconUrl property: The iconUrl property. + * + * @return the iconUrl value. + */ + public String iconUrl() { + return this.iconUrl; + } + + /** + * Get the acceleratorTags property: The acceleratorTags property. + * + * @return the acceleratorTags value. + */ + public List acceleratorTags() { + return this.acceleratorTags; + } + + /** + * Get the state property: State of the predefined accelerator. + * + * @return the state value. + */ + public PredefinedAcceleratorState state() { + return this.state; + } + + /** + * Set the state property: State of the predefined accelerator. + * + * @param state the state value to set. + * @return the PredefinedAcceleratorProperties object itself. + */ + public PredefinedAcceleratorProperties withState(PredefinedAcceleratorState state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorProvisioningState.java new file mode 100644 index 0000000000000..b750e3c234c27 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the predefined accelerator. */ +public final class PredefinedAcceleratorProvisioningState + extends ExpandableStringEnum { + /** Static value Creating for PredefinedAcceleratorProvisioningState. */ + public static final PredefinedAcceleratorProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for PredefinedAcceleratorProvisioningState. */ + public static final PredefinedAcceleratorProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for PredefinedAcceleratorProvisioningState. */ + public static final PredefinedAcceleratorProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for PredefinedAcceleratorProvisioningState. */ + public static final PredefinedAcceleratorProvisioningState FAILED = fromString("Failed"); + + /** + * Creates a new instance of PredefinedAcceleratorProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PredefinedAcceleratorProvisioningState() { + } + + /** + * Creates or finds a PredefinedAcceleratorProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PredefinedAcceleratorProvisioningState. + */ + @JsonCreator + public static PredefinedAcceleratorProvisioningState fromString(String name) { + return fromString(name, PredefinedAcceleratorProvisioningState.class); + } + + /** + * Gets known PredefinedAcceleratorProvisioningState values. + * + * @return known PredefinedAcceleratorProvisioningState values. + */ + public static Collection values() { + return values(PredefinedAcceleratorProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorResource.java new file mode 100644 index 0000000000000..28b668b23b1af --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorResource.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner; + +/** An immutable client-side representation of PredefinedAcceleratorResource. */ +public interface PredefinedAcceleratorResource { + /** + * 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 properties property: Predefined accelerator properties payload. + * + * @return the properties value. + */ + PredefinedAcceleratorProperties properties(); + + /** + * Gets the sku property: Sku of the predefined accelerator 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 inner com.azure.resourcemanager.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner + * object. + * + * @return the inner object. + */ + PredefinedAcceleratorResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorResourceCollection.java new file mode 100644 index 0000000000000..c479e05f21267 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorResourceCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.PredefinedAcceleratorResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The PredefinedAcceleratorResourceCollection model. */ +@Fluent +public final class PredefinedAcceleratorResourceCollection { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of PredefinedAcceleratorResourceCollection class. */ + public PredefinedAcceleratorResourceCollection() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the PredefinedAcceleratorResourceCollection object itself. + */ + public PredefinedAcceleratorResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the PredefinedAcceleratorResourceCollection object itself. + */ + public PredefinedAcceleratorResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorState.java new file mode 100644 index 0000000000000..f520c34a20232 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAcceleratorState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the predefined accelerator. */ +public final class PredefinedAcceleratorState extends ExpandableStringEnum { + /** Static value Enabled for PredefinedAcceleratorState. */ + public static final PredefinedAcceleratorState ENABLED = fromString("Enabled"); + + /** Static value Disabled for PredefinedAcceleratorState. */ + public static final PredefinedAcceleratorState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PredefinedAcceleratorState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PredefinedAcceleratorState() { + } + + /** + * Creates or finds a PredefinedAcceleratorState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PredefinedAcceleratorState. + */ + @JsonCreator + public static PredefinedAcceleratorState fromString(String name) { + return fromString(name, PredefinedAcceleratorState.class); + } + + /** + * Gets known PredefinedAcceleratorState values. + * + * @return known PredefinedAcceleratorState values. + */ + public static Collection values() { + return values(PredefinedAcceleratorState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAccelerators.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAccelerators.java new file mode 100644 index 0000000000000..57d149f384e26 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PredefinedAccelerators.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PredefinedAccelerators. */ +public interface PredefinedAccelerators { + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName); + + /** + * Handle requests to list all predefined accelerators. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @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 paginated response with {@link PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String applicationAcceleratorName, Context context); + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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 predefined accelerator along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); + + /** + * Get the predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the predefined accelerator. + */ + PredefinedAcceleratorResource get( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Disable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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 disable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName); + + /** + * Enable predefined accelerator. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param applicationAcceleratorName The name of the application accelerator. + * @param predefinedAcceleratorName The name of the predefined accelerator. + * @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 enable( + String resourceGroupName, + String serviceName, + String applicationAcceleratorName, + String predefinedAcceleratorName, + Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Probe.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Probe.java new file mode 100644 index 0000000000000..530f987f2fb79 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Probe.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to + * receive traffic. + */ +@Fluent +public final class Probe { + /* + * The action of the probe. + */ + @JsonProperty(value = "probeAction") + private ProbeAction probeAction; + + /* + * Indicate whether the probe is disabled. + */ + @JsonProperty(value = "disableProbe", required = true) + private boolean disableProbe; + + /* + * Number of seconds after the App Instance has started before probes are initiated. More info: + * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + */ + @JsonProperty(value = "initialDelaySeconds") + private Integer initialDelaySeconds; + + /* + * How often (in seconds) to perform the probe. Minimum value is 1. + */ + @JsonProperty(value = "periodSeconds") + private Integer periodSeconds; + + /* + * Number of seconds after which the probe times out. Minimum value is 1. + */ + @JsonProperty(value = "timeoutSeconds") + private Integer timeoutSeconds; + + /* + * Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1. + */ + @JsonProperty(value = "failureThreshold") + private Integer failureThreshold; + + /* + * Minimum consecutive successes for the probe to be considered successful after having failed. Must be 1 for + * liveness and startup. Minimum value is 1. + */ + @JsonProperty(value = "successThreshold") + private Integer successThreshold; + + /** Creates an instance of Probe class. */ + public Probe() { + } + + /** + * Get the probeAction property: The action of the probe. + * + * @return the probeAction value. + */ + public ProbeAction probeAction() { + return this.probeAction; + } + + /** + * Set the probeAction property: The action of the probe. + * + * @param probeAction the probeAction value to set. + * @return the Probe object itself. + */ + public Probe withProbeAction(ProbeAction probeAction) { + this.probeAction = probeAction; + return this; + } + + /** + * Get the disableProbe property: Indicate whether the probe is disabled. + * + * @return the disableProbe value. + */ + public boolean disableProbe() { + return this.disableProbe; + } + + /** + * Set the disableProbe property: Indicate whether the probe is disabled. + * + * @param disableProbe the disableProbe value to set. + * @return the Probe object itself. + */ + public Probe withDisableProbe(boolean disableProbe) { + this.disableProbe = disableProbe; + return this; + } + + /** + * Get the initialDelaySeconds property: Number of seconds after the App Instance has started before probes are + * initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @return the initialDelaySeconds value. + */ + public Integer initialDelaySeconds() { + return this.initialDelaySeconds; + } + + /** + * Set the initialDelaySeconds property: Number of seconds after the App Instance has started before probes are + * initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes. + * + * @param initialDelaySeconds the initialDelaySeconds value to set. + * @return the Probe object itself. + */ + public Probe withInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Get the periodSeconds property: How often (in seconds) to perform the probe. Minimum value is 1. + * + * @return the periodSeconds value. + */ + public Integer periodSeconds() { + return this.periodSeconds; + } + + /** + * Set the periodSeconds property: How often (in seconds) to perform the probe. Minimum value is 1. + * + * @param periodSeconds the periodSeconds value to set. + * @return the Probe object itself. + */ + public Probe withPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + return this; + } + + /** + * Get the timeoutSeconds property: Number of seconds after which the probe times out. Minimum value is 1. + * + * @return the timeoutSeconds value. + */ + public Integer timeoutSeconds() { + return this.timeoutSeconds; + } + + /** + * Set the timeoutSeconds property: Number of seconds after which the probe times out. Minimum value is 1. + * + * @param timeoutSeconds the timeoutSeconds value to set. + * @return the Probe object itself. + */ + public Probe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + + /** + * Get the failureThreshold property: Minimum consecutive failures for the probe to be considered failed after + * having succeeded. Minimum value is 1. + * + * @return the failureThreshold value. + */ + public Integer failureThreshold() { + return this.failureThreshold; + } + + /** + * Set the failureThreshold property: Minimum consecutive failures for the probe to be considered failed after + * having succeeded. Minimum value is 1. + * + * @param failureThreshold the failureThreshold value to set. + * @return the Probe object itself. + */ + public Probe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the successThreshold property: Minimum consecutive successes for the probe to be considered successful after + * having failed. Must be 1 for liveness and startup. Minimum value is 1. + * + * @return the successThreshold value. + */ + public Integer successThreshold() { + return this.successThreshold; + } + + /** + * Set the successThreshold property: Minimum consecutive successes for the probe to be considered successful after + * having failed. Must be 1 for liveness and startup. Minimum value is 1. + * + * @param successThreshold the successThreshold value to set. + * @return the Probe object itself. + */ + public Probe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (probeAction() != null) { + probeAction().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProbeAction.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProbeAction.java new file mode 100644 index 0000000000000..9191e78247e68 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProbeAction.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The action of the probe. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = ProbeAction.class) +@JsonTypeName("ProbeAction") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "HTTPGetAction", value = HttpGetAction.class), + @JsonSubTypes.Type(name = "ExecAction", value = ExecAction.class), + @JsonSubTypes.Type(name = "TCPSocketAction", value = TcpSocketAction.class) +}) +@Immutable +public class ProbeAction { + /** Creates an instance of ProbeAction class. */ + public ProbeAction() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProbeActionType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProbeActionType.java new file mode 100644 index 0000000000000..46c15250d6b49 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProbeActionType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the action to take to perform the health check. */ +public final class ProbeActionType extends ExpandableStringEnum { + /** Static value HTTPGetAction for ProbeActionType. */ + public static final ProbeActionType HTTPGET_ACTION = fromString("HTTPGetAction"); + + /** Static value TCPSocketAction for ProbeActionType. */ + public static final ProbeActionType TCPSOCKET_ACTION = fromString("TCPSocketAction"); + + /** Static value ExecAction for ProbeActionType. */ + public static final ProbeActionType EXEC_ACTION = fromString("ExecAction"); + + /** + * Creates a new instance of ProbeActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProbeActionType() { + } + + /** + * Creates or finds a ProbeActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProbeActionType. + */ + @JsonCreator + public static ProbeActionType fromString(String name) { + return fromString(name, ProbeActionType.class); + } + + /** + * Gets known ProbeActionType values. + * + * @return known ProbeActionType values. + */ + public static Collection values() { + return values(ProbeActionType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProvisioningState.java new file mode 100644 index 0000000000000..3f6dd0b95bc59 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the Service. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Starting for ProvisioningState. */ + public static final ProvisioningState STARTING = fromString("Starting"); + + /** Static value Stopping for ProvisioningState. */ + public static final ProvisioningState STOPPING = fromString("Stopping"); + + /** 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 Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** Static value Moved for ProvisioningState. */ + public static final ProvisioningState MOVED = fromString("Moved"); + + /** Static value MoveFailed for ProvisioningState. */ + public static final ProvisioningState MOVE_FAILED = fromString("MoveFailed"); + + /** + * 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/QueueScaleRule.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/QueueScaleRule.java new file mode 100644 index 0000000000000..0cbbb83cc1642 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/QueueScaleRule.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure Spring Apps App Instance Azure Queue based scaling rule. */ +@Fluent +public final class QueueScaleRule { + /* + * Queue name. + */ + @JsonProperty(value = "queueName") + private String queueName; + + /* + * Queue length. + */ + @JsonProperty(value = "queueLength") + private Integer queueLength; + + /* + * Authentication secrets for the queue scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** Creates an instance of QueueScaleRule class. */ + public QueueScaleRule() { + } + + /** + * Get the queueName property: Queue name. + * + * @return the queueName value. + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the queueName property: Queue name. + * + * @param queueName the queueName value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get the queueLength property: Queue length. + * + * @return the queueLength value. + */ + public Integer queueLength() { + return this.queueLength; + } + + /** + * Set the queueLength property: Queue length. + * + * @param queueLength the queueLength value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withQueueLength(Integer queueLength) { + this.queueLength = queueLength; + return this; + } + + /** + * Get the auth property: Authentication secrets for the queue scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the queue scale rule. + * + * @param auth the auth value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RegenerateTestKeyRequestPayload.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RegenerateTestKeyRequestPayload.java new file mode 100644 index 0000000000000..fa74184fb8598 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RegenerateTestKeyRequestPayload.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Regenerate test key request payload. */ +@Fluent +public final class RegenerateTestKeyRequestPayload { + /* + * Type of the test key + */ + @JsonProperty(value = "keyType", required = true) + private TestKeyType keyType; + + /** Creates an instance of RegenerateTestKeyRequestPayload class. */ + public RegenerateTestKeyRequestPayload() { + } + + /** + * Get the keyType property: Type of the test key. + * + * @return the keyType value. + */ + public TestKeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: Type of the test key. + * + * @param keyType the keyType value to set. + * @return the RegenerateTestKeyRequestPayload object itself. + */ + public RegenerateTestKeyRequestPayload withKeyType(TestKeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property keyType in model RegenerateTestKeyRequestPayload")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RegenerateTestKeyRequestPayload.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RemoteDebugging.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RemoteDebugging.java new file mode 100644 index 0000000000000..e6d4ebb2f38ee --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RemoteDebugging.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.RemoteDebuggingInner; + +/** An immutable client-side representation of RemoteDebugging. */ +public interface RemoteDebugging { + /** + * Gets the port property: Application debugging port. + * + * @return the port value. + */ + Integer port(); + + /** + * Gets the enabled property: Indicate if remote debugging is enabled. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.RemoteDebuggingInner object. + * + * @return the inner object. + */ + RemoteDebuggingInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RemoteDebuggingPayload.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RemoteDebuggingPayload.java new file mode 100644 index 0000000000000..c6868c4eca374 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RemoteDebuggingPayload.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Remote debugging payload. */ +@Fluent +public final class RemoteDebuggingPayload { + /* + * Application debugging port. + */ + @JsonProperty(value = "port") + private Integer port; + + /** Creates an instance of RemoteDebuggingPayload class. */ + public RemoteDebuggingPayload() { + } + + /** + * Get the port property: Application debugging port. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Set the port property: Application debugging port. + * + * @param port the port value to set. + * @return the RemoteDebuggingPayload object itself. + */ + public RemoteDebuggingPayload withPort(Integer port) { + this.port = port; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RequiredTraffic.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RequiredTraffic.java new file mode 100644 index 0000000000000..db8620ae4bd4d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RequiredTraffic.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Required inbound or outbound traffic for Azure Spring Apps resource. */ +@Immutable +public final class RequiredTraffic { + /* + * The protocol of required traffic + */ + @JsonProperty(value = "protocol", access = JsonProperty.Access.WRITE_ONLY) + private String protocol; + + /* + * The port of required traffic + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Integer port; + + /* + * The ip list of required traffic + */ + @JsonProperty(value = "ips", access = JsonProperty.Access.WRITE_ONLY) + private List ips; + + /* + * The FQDN list of required traffic + */ + @JsonProperty(value = "fqdns", access = JsonProperty.Access.WRITE_ONLY) + private List fqdns; + + /* + * The direction of required traffic + */ + @JsonProperty(value = "direction", access = JsonProperty.Access.WRITE_ONLY) + private TrafficDirection direction; + + /** Creates an instance of RequiredTraffic class. */ + public RequiredTraffic() { + } + + /** + * Get the protocol property: The protocol of required traffic. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Get the port property: The port of required traffic. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Get the ips property: The ip list of required traffic. + * + * @return the ips value. + */ + public List ips() { + return this.ips; + } + + /** + * Get the fqdns property: The FQDN list of required traffic. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Get the direction property: The direction of required traffic. + * + * @return the direction value. + */ + public TrafficDirection direction() { + return this.direction; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceRequests.java new file mode 100644 index 0000000000000..9f6636079edc0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceRequests.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment resource request payload. */ +@Fluent +public final class ResourceRequests { + /* + * Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic tier, and {500m, 1, 2, + * 3, 4} for Standard tier. + */ + @JsonProperty(value = "cpu") + private String cpu; + + /* + * Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} for Basic tier, and + * {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier. + */ + @JsonProperty(value = "memory") + private String memory; + + /** Creates an instance of ResourceRequests class. */ + public ResourceRequests() { + } + + /** + * Get the cpu property: Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic + * tier, and {500m, 1, 2, 3, 4} for Standard tier. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic + * tier, and {500m, 1, 2, 3, 4} for Standard tier. + * + * @param cpu the cpu value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(String cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, + * 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, + * 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, ..., 8Gi} for Standard tier. + * + * @param memory the memory value to set. + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSku.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSku.java new file mode 100644 index 0000000000000..708b489fba13b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSku.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner; +import java.util.List; + +/** An immutable client-side representation of ResourceSku. */ +public interface ResourceSku { + /** + * Gets the resourceType property: Gets the type of resource the SKU applies to. + * + * @return the resourceType value. + */ + String resourceType(); + + /** + * Gets the name property: Gets the name of SKU. + * + * @return the name value. + */ + String name(); + + /** + * Gets the tier property: Gets the tier of SKU. + * + * @return the tier value. + */ + String tier(); + + /** + * Gets the capacity property: Gets the capacity of SKU. + * + * @return the capacity value. + */ + SkuCapacity capacity(); + + /** + * Gets the locations property: Gets the set of locations that the SKU is available. + * + * @return the locations value. + */ + List locations(); + + /** + * Gets the locationInfo property: Gets a list of locations and availability zones in those locations where the SKU + * is available. + * + * @return the locationInfo value. + */ + List locationInfo(); + + /** + * Gets the restrictions property: Gets the restrictions because of which SKU cannot be used. This is empty if there + * are no restrictions. + * + * @return the restrictions value. + */ + List restrictions(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner object. + * + * @return the inner object. + */ + ResourceSkuInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuCapabilities.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuCapabilities.java new file mode 100644 index 0000000000000..8e6bc44803fcf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuCapabilities.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceSkuCapabilities model. */ +@Fluent +public final class ResourceSkuCapabilities { + /* + * Gets an invariant to describe the feature. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Gets an invariant if the feature is measured by quantity. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of ResourceSkuCapabilities class. */ + public ResourceSkuCapabilities() { + } + + /** + * Get the name property: Gets an invariant to describe the feature. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Gets an invariant to describe the feature. + * + * @param name the name value to set. + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Gets an invariant if the feature is measured by quantity. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Gets an invariant if the feature is measured by quantity. + * + * @param value the value value to set. + * @return the ResourceSkuCapabilities object itself. + */ + public ResourceSkuCapabilities withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuCollection.java new file mode 100644 index 0000000000000..2b51bd5b6bb74 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Azure Spring Apps SKU and a possible link for next set. */ +@Fluent +public final class ResourceSkuCollection { + /* + * Collection of resource SKU + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ResourceSkuCollection class. */ + public ResourceSkuCollection() { + } + + /** + * Get the value property: Collection of resource SKU. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resource SKU. + * + * @param value the value value to set. + * @return the ResourceSkuCollection object itself. + */ + public ResourceSkuCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ResourceSkuCollection object itself. + */ + public ResourceSkuCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuLocationInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuLocationInfo.java new file mode 100644 index 0000000000000..ced828fb04510 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuLocationInfo.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Locations and availability zones where the SKU is available. */ +@Fluent +public final class ResourceSkuLocationInfo { + /* + * Gets location of the SKU + */ + @JsonProperty(value = "location") + private String location; + + /* + * Gets list of availability zones where the SKU is supported. + */ + @JsonProperty(value = "zones") + private List zones; + + /* + * Gets details of capabilities available to a SKU in specific zones. + */ + @JsonProperty(value = "zoneDetails") + private List zoneDetails; + + /** Creates an instance of ResourceSkuLocationInfo class. */ + public ResourceSkuLocationInfo() { + } + + /** + * Get the location property: Gets location of the SKU. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Gets location of the SKU. + * + * @param location the location value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the zones property: Gets list of availability zones where the SKU is supported. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Gets list of availability zones where the SKU is supported. + * + * @param zones the zones value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Get the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @return the zoneDetails value. + */ + public List zoneDetails() { + return this.zoneDetails; + } + + /** + * Set the zoneDetails property: Gets details of capabilities available to a SKU in specific zones. + * + * @param zoneDetails the zoneDetails value to set. + * @return the ResourceSkuLocationInfo object itself. + */ + public ResourceSkuLocationInfo withZoneDetails(List zoneDetails) { + this.zoneDetails = zoneDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (zoneDetails() != null) { + zoneDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionInfo.java new file mode 100644 index 0000000000000..42fe80b5642cf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionInfo.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Information about the restriction where the SKU cannot be used. */ +@Fluent +public final class ResourceSkuRestrictionInfo { + /* + * Gets locations where the SKU is restricted + */ + @JsonProperty(value = "locations") + private List locations; + + /* + * Gets list of availability zones where the SKU is restricted. + */ + @JsonProperty(value = "zones") + private List zones; + + /** Creates an instance of ResourceSkuRestrictionInfo class. */ + public ResourceSkuRestrictionInfo() { + } + + /** + * Get the locations property: Gets locations where the SKU is restricted. + * + * @return the locations value. + */ + public List locations() { + return this.locations; + } + + /** + * Set the locations property: Gets locations where the SKU is restricted. + * + * @param locations the locations value to set. + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withLocations(List locations) { + this.locations = locations; + return this; + } + + /** + * Get the zones property: Gets list of availability zones where the SKU is restricted. + * + * @return the zones value. + */ + public List zones() { + return this.zones; + } + + /** + * Set the zones property: Gets list of availability zones where the SKU is restricted. + * + * @param zones the zones value to set. + * @return the ResourceSkuRestrictionInfo object itself. + */ + public ResourceSkuRestrictionInfo withZones(List zones) { + this.zones = zones; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictions.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictions.java new file mode 100644 index 0000000000000..b357fa9d53556 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictions.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Restrictions where the SKU cannot be used. */ +@Fluent +public final class ResourceSkuRestrictions { + /* + * Gets the type of restrictions. Possible values include: 'Location', 'Zone' + */ + @JsonProperty(value = "type") + private ResourceSkuRestrictionsType type; + + /* + * Gets the value of restrictions. If the restriction type is set to + * location. This would be different locations where the SKU is restricted. + */ + @JsonProperty(value = "values") + private List values; + + /* + * Gets the information about the restriction where the SKU cannot be used. + */ + @JsonProperty(value = "restrictionInfo") + private ResourceSkuRestrictionInfo restrictionInfo; + + /* + * Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' + */ + @JsonProperty(value = "reasonCode") + private ResourceSkuRestrictionsReasonCode reasonCode; + + /** Creates an instance of ResourceSkuRestrictions class. */ + public ResourceSkuRestrictions() { + } + + /** + * Get the type property: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @return the type value. + */ + public ResourceSkuRestrictionsType type() { + return this.type; + } + + /** + * Set the type property: Gets the type of restrictions. Possible values include: 'Location', 'Zone'. + * + * @param type the type value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withType(ResourceSkuRestrictionsType type) { + this.type = type; + return this; + } + + /** + * Get the values property: Gets the value of restrictions. If the restriction type is set to location. This would + * be different locations where the SKU is restricted. + * + * @return the values value. + */ + public List values() { + return this.values; + } + + /** + * Set the values property: Gets the value of restrictions. If the restriction type is set to location. This would + * be different locations where the SKU is restricted. + * + * @param values the values value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withValues(List values) { + this.values = values; + return this; + } + + /** + * Get the restrictionInfo property: Gets the information about the restriction where the SKU cannot be used. + * + * @return the restrictionInfo value. + */ + public ResourceSkuRestrictionInfo restrictionInfo() { + return this.restrictionInfo; + } + + /** + * Set the restrictionInfo property: Gets the information about the restriction where the SKU cannot be used. + * + * @param restrictionInfo the restrictionInfo value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withRestrictionInfo(ResourceSkuRestrictionInfo restrictionInfo) { + this.restrictionInfo = restrictionInfo; + return this; + } + + /** + * Get the reasonCode property: Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + * + * @return the reasonCode value. + */ + public ResourceSkuRestrictionsReasonCode reasonCode() { + return this.reasonCode; + } + + /** + * Set the reasonCode property: Gets the reason for restriction. Possible values include: 'QuotaId', + * 'NotAvailableForSubscription'. + * + * @param reasonCode the reasonCode value to set. + * @return the ResourceSkuRestrictions object itself. + */ + public ResourceSkuRestrictions withReasonCode(ResourceSkuRestrictionsReasonCode reasonCode) { + this.reasonCode = reasonCode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restrictionInfo() != null) { + restrictionInfo().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsReasonCode.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsReasonCode.java new file mode 100644 index 0000000000000..b6e7c2e9c6b17 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsReasonCode.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. */ +public final class ResourceSkuRestrictionsReasonCode extends ExpandableStringEnum { + /** Static value QuotaId for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode QUOTA_ID = fromString("QuotaId"); + + /** Static value NotAvailableForSubscription for ResourceSkuRestrictionsReasonCode. */ + public static final ResourceSkuRestrictionsReasonCode NOT_AVAILABLE_FOR_SUBSCRIPTION = + fromString("NotAvailableForSubscription"); + + /** + * Creates a new instance of ResourceSkuRestrictionsReasonCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceSkuRestrictionsReasonCode() { + } + + /** + * Creates or finds a ResourceSkuRestrictionsReasonCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsReasonCode. + */ + @JsonCreator + public static ResourceSkuRestrictionsReasonCode fromString(String name) { + return fromString(name, ResourceSkuRestrictionsReasonCode.class); + } + + /** + * Gets known ResourceSkuRestrictionsReasonCode values. + * + * @return known ResourceSkuRestrictionsReasonCode values. + */ + public static Collection values() { + return values(ResourceSkuRestrictionsReasonCode.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsType.java new file mode 100644 index 0000000000000..02eb66839dfba --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets the type of restrictions. Possible values include: 'Location', 'Zone'. */ +public final class ResourceSkuRestrictionsType extends ExpandableStringEnum { + /** Static value Location for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType LOCATION = fromString("Location"); + + /** Static value Zone for ResourceSkuRestrictionsType. */ + public static final ResourceSkuRestrictionsType ZONE = fromString("Zone"); + + /** + * Creates a new instance of ResourceSkuRestrictionsType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceSkuRestrictionsType() { + } + + /** + * Creates or finds a ResourceSkuRestrictionsType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceSkuRestrictionsType. + */ + @JsonCreator + public static ResourceSkuRestrictionsType fromString(String name) { + return fromString(name, ResourceSkuRestrictionsType.class); + } + + /** + * Gets known ResourceSkuRestrictionsType values. + * + * @return known ResourceSkuRestrictionsType values. + */ + public static Collection values() { + return values(ResourceSkuRestrictionsType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuZoneDetails.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuZoneDetails.java new file mode 100644 index 0000000000000..267ee233ea030 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuZoneDetails.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details of capabilities available to a SKU in specific zones. */ +@Fluent +public final class ResourceSkuZoneDetails { + /* + * Gets the set of zones that the SKU is available in with the + * specified capabilities. + */ + @JsonProperty(value = "name") + private List name; + + /* + * Gets a list of capabilities that are available for the SKU in the + * specified list of zones. + */ + @JsonProperty(value = "capabilities") + private List capabilities; + + /** Creates an instance of ResourceSkuZoneDetails class. */ + public ResourceSkuZoneDetails() { + } + + /** + * Get the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @return the name value. + */ + public List name() { + return this.name; + } + + /** + * Set the name property: Gets the set of zones that the SKU is available in with the specified capabilities. + * + * @param name the name value to set. + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withName(List name) { + this.name = name; + return this; + } + + /** + * Get the capabilities property: Gets a list of capabilities that are available for the SKU in the specified list + * of zones. + * + * @return the capabilities value. + */ + public List capabilities() { + return this.capabilities; + } + + /** + * Set the capabilities property: Gets a list of capabilities that are available for the SKU in the specified list + * of zones. + * + * @param capabilities the capabilities value to set. + * @return the ResourceSkuZoneDetails object itself. + */ + public ResourceSkuZoneDetails withCapabilities(List capabilities) { + this.capabilities = capabilities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (capabilities() != null) { + capabilities().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceUploadDefinition.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceUploadDefinition.java new file mode 100644 index 0000000000000..e4e31febd4718 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceUploadDefinition.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner; + +/** An immutable client-side representation of ResourceUploadDefinition. */ +public interface ResourceUploadDefinition { + /** + * Gets the relativePath property: Source relative path. + * + * @return the relativePath value. + */ + String relativePath(); + + /** + * Gets the uploadUrl property: Upload URL. + * + * @return the uploadUrl value. + */ + String uploadUrl(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceUploadDefinitionInner + * object. + * + * @return the inner object. + */ + ResourceUploadDefinitionInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RuntimeVersions.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RuntimeVersions.java new file mode 100644 index 0000000000000..f0a21c71ad40d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RuntimeVersions.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.appplatform.generated.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RuntimeVersions. */ +public interface RuntimeVersions { + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @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 body along with {@link Response}. + */ + Response listRuntimeVersionsWithResponse(Context context); + + /** + * Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. + * + * @throws com.azure.core.management.exception.ManagementException 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. + */ + AvailableRuntimeVersions listRuntimeVersions(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Scale.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Scale.java new file mode 100644 index 0000000000000..a77c36f1b02d6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Scale.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Azure Spring Apps scaling configurations. */ +@Fluent +public final class Scale { + /* + * Optional. Minimum number of container replicas. + */ + @JsonProperty(value = "minReplicas") + private Integer minReplicas; + + /* + * Optional. Maximum number of container replicas. Defaults to 10 if not set. + */ + @JsonProperty(value = "maxReplicas") + private Integer maxReplicas; + + /* + * Scaling rules. + */ + @JsonProperty(value = "rules") + private List rules; + + /** Creates an instance of Scale class. */ + public Scale() { + } + + /** + * Get the minReplicas property: Optional. Minimum number of container replicas. + * + * @return the minReplicas value. + */ + public Integer minReplicas() { + return this.minReplicas; + } + + /** + * Set the minReplicas property: Optional. Minimum number of container replicas. + * + * @param minReplicas the minReplicas value to set. + * @return the Scale object itself. + */ + public Scale withMinReplicas(Integer minReplicas) { + this.minReplicas = minReplicas; + return this; + } + + /** + * Get the maxReplicas property: Optional. Maximum number of container replicas. Defaults to 10 if not set. + * + * @return the maxReplicas value. + */ + public Integer maxReplicas() { + return this.maxReplicas; + } + + /** + * Set the maxReplicas property: Optional. Maximum number of container replicas. Defaults to 10 if not set. + * + * @param maxReplicas the maxReplicas value to set. + * @return the Scale object itself. + */ + public Scale withMaxReplicas(Integer maxReplicas) { + this.maxReplicas = maxReplicas; + return this; + } + + /** + * Get the rules property: Scaling rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Scaling rules. + * + * @param rules the rules value to set. + * @return the Scale object itself. + */ + public Scale withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ScaleRule.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ScaleRule.java new file mode 100644 index 0000000000000..6cf0d89184340 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ScaleRule.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure Spring Apps App Instance scaling rule. */ +@Fluent +public final class ScaleRule { + /* + * Scale Rule Name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Azure Queue based scaling. + */ + @JsonProperty(value = "azureQueue") + private QueueScaleRule azureQueue; + + /* + * Custom scale rule. + */ + @JsonProperty(value = "custom") + private CustomScaleRule custom; + + /* + * HTTP requests based scaling. + */ + @JsonProperty(value = "http") + private HttpScaleRule http; + + /* + * Tcp requests based scaling. + */ + @JsonProperty(value = "tcp") + private TcpScaleRule tcp; + + /** Creates an instance of ScaleRule class. */ + public ScaleRule() { + } + + /** + * Get the name property: Scale Rule Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Scale Rule Name. + * + * @param name the name value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the azureQueue property: Azure Queue based scaling. + * + * @return the azureQueue value. + */ + public QueueScaleRule azureQueue() { + return this.azureQueue; + } + + /** + * Set the azureQueue property: Azure Queue based scaling. + * + * @param azureQueue the azureQueue value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withAzureQueue(QueueScaleRule azureQueue) { + this.azureQueue = azureQueue; + return this; + } + + /** + * Get the custom property: Custom scale rule. + * + * @return the custom value. + */ + public CustomScaleRule custom() { + return this.custom; + } + + /** + * Set the custom property: Custom scale rule. + * + * @param custom the custom value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withCustom(CustomScaleRule custom) { + this.custom = custom; + return this; + } + + /** + * Get the http property: HTTP requests based scaling. + * + * @return the http value. + */ + public HttpScaleRule http() { + return this.http; + } + + /** + * Set the http property: HTTP requests based scaling. + * + * @param http the http value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withHttp(HttpScaleRule http) { + this.http = http; + return this; + } + + /** + * Get the tcp property: Tcp requests based scaling. + * + * @return the tcp value. + */ + public TcpScaleRule tcp() { + return this.tcp; + } + + /** + * Set the tcp property: Tcp requests based scaling. + * + * @param tcp the tcp value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withTcp(TcpScaleRule tcp) { + this.tcp = tcp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureQueue() != null) { + azureQueue().validate(); + } + if (custom() != null) { + custom().validate(); + } + if (http() != null) { + http().validate(); + } + if (tcp() != null) { + tcp().validate(); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ScaleRuleAuth.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ScaleRuleAuth.java new file mode 100644 index 0000000000000..ca9c6dda1fc0c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ScaleRuleAuth.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Auth Secrets for Azure Spring Apps App Instance Scale Rule. */ +@Fluent +public final class ScaleRuleAuth { + /* + * Name of the Azure Spring Apps App Instance secret from which to pull the auth params. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /* + * Trigger Parameter that uses the secret + */ + @JsonProperty(value = "triggerParameter") + private String triggerParameter; + + /** Creates an instance of ScaleRuleAuth class. */ + public ScaleRuleAuth() { + } + + /** + * Get the secretRef property: Name of the Azure Spring Apps App Instance secret from which to pull the auth params. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: Name of the Azure Spring Apps App Instance secret from which to pull the auth params. + * + * @param secretRef the secretRef value to set. + * @return the ScaleRuleAuth object itself. + */ + public ScaleRuleAuth withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Get the triggerParameter property: Trigger Parameter that uses the secret. + * + * @return the triggerParameter value. + */ + public String triggerParameter() { + return this.triggerParameter; + } + + /** + * Set the triggerParameter property: Trigger Parameter that uses the secret. + * + * @param triggerParameter the triggerParameter value to set. + * @return the ScaleRuleAuth object itself. + */ + public ScaleRuleAuth withTriggerParameter(String triggerParameter) { + this.triggerParameter = triggerParameter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Secret.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Secret.java new file mode 100644 index 0000000000000..114b6fae76879 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Secret.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Secret definition. */ +@Fluent +public final class Secret { + /* + * Secret Name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Secret Value. + */ + @JsonProperty(value = "value") + private String value; + + /** Creates an instance of Secret class. */ + public Secret() { + } + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Secret Name. + * + * @param name the name value to set. + * @return the Secret object itself. + */ + public Secret withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Secret Value. + * + * @param value the value value to set. + * @return the Secret object itself. + */ + public Secret withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistries.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistries.java new file mode 100644 index 0000000000000..1edc000a46c57 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistries.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.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ServiceRegistries. */ +public interface ServiceRegistries { + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 Service Registry and its properties along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context); + + /** + * Get the Service Registry and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Service Registry and its properties. + */ + ServiceRegistryResource get(String resourceGroupName, String serviceName, String serviceRegistryName); + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return service Registry resource. + */ + ServiceRegistryResource createOrUpdate(String resourceGroupName, String serviceName, String serviceRegistryName); + + /** + * Create the default Service Registry or update the existing Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 service Registry resource. + */ + ServiceRegistryResource createOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context); + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 serviceName, String serviceRegistryName); + + /** + * Disable the default Service Registry. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param serviceRegistryName The name of Service Registry. + * @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 serviceName, String serviceRegistryName, Context context); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * Handles requests to list all resources in a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service Registry resources and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryInstance.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryInstance.java new file mode 100644 index 0000000000000..b223ebaa8e168 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryInstance.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Service Registry. */ +@Immutable +public final class ServiceRegistryInstance { + /* + * Name of the Service Registry instance + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Status of the Service Registry instance + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** Creates an instance of ServiceRegistryInstance class. */ + public ServiceRegistryInstance() { + } + + /** + * Get the name property: Name of the Service Registry instance. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Status of the Service Registry instance. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProperties.java new file mode 100644 index 0000000000000..dd222b2b48311 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Registry properties payload. */ +@Immutable +public final class ServiceRegistryProperties { + /* + * State of the Service Registry. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ServiceRegistryProvisioningState provisioningState; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests", access = JsonProperty.Access.WRITE_ONLY) + private ServiceRegistryResourceRequests resourceRequests; + + /* + * Collection of instances belong to Service Registry. + */ + @JsonProperty(value = "instances", access = JsonProperty.Access.WRITE_ONLY) + private List instances; + + /** Creates an instance of ServiceRegistryProperties class. */ + public ServiceRegistryProperties() { + } + + /** + * Get the provisioningState property: State of the Service Registry. + * + * @return the provisioningState value. + */ + public ServiceRegistryProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resourceRequests property: The requested resource quantity for required CPU and Memory. + * + * @return the resourceRequests value. + */ + public ServiceRegistryResourceRequests resourceRequests() { + return this.resourceRequests; + } + + /** + * Get the instances property: Collection of instances belong to Service Registry. + * + * @return the instances value. + */ + public List instances() { + return this.instances; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resourceRequests() != null) { + resourceRequests().validate(); + } + if (instances() != null) { + instances().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProvisioningState.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProvisioningState.java new file mode 100644 index 0000000000000..a9b620fedb6dc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProvisioningState.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of the Service Registry. */ +public final class ServiceRegistryProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ServiceRegistryProvisioningState. */ + public static final ServiceRegistryProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ServiceRegistryProvisioningState. */ + public static final ServiceRegistryProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ServiceRegistryProvisioningState. */ + public static final ServiceRegistryProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ServiceRegistryProvisioningState. */ + public static final ServiceRegistryProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for ServiceRegistryProvisioningState. */ + public static final ServiceRegistryProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of ServiceRegistryProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServiceRegistryProvisioningState() { + } + + /** + * Creates or finds a ServiceRegistryProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceRegistryProvisioningState. + */ + @JsonCreator + public static ServiceRegistryProvisioningState fromString(String name) { + return fromString(name, ServiceRegistryProvisioningState.class); + } + + /** + * Gets known ServiceRegistryProvisioningState values. + * + * @return known ServiceRegistryProvisioningState values. + */ + public static Collection values() { + return values(ServiceRegistryProvisioningState.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResource.java new file mode 100644 index 0000000000000..3253572766586 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner; + +/** An immutable client-side representation of ServiceRegistryResource. */ +public interface ServiceRegistryResource { + /** + * 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 properties property: Service Registry properties payload. + * + * @return the properties value. + */ + ServiceRegistryProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner object. + * + * @return the inner object. + */ + ServiceRegistryResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResourceCollection.java new file mode 100644 index 0000000000000..b3c44a17713da --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResourceCollection.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Service Registry resources and a possible link for next set. */ +@Fluent +public final class ServiceRegistryResourceCollection { + /* + * Collection of Service Registry resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ServiceRegistryResourceCollection class. */ + public ServiceRegistryResourceCollection() { + } + + /** + * Get the value property: Collection of Service Registry resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Service Registry resources. + * + * @param value the value value to set. + * @return the ServiceRegistryResourceCollection object itself. + */ + public ServiceRegistryResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ServiceRegistryResourceCollection object itself. + */ + public ServiceRegistryResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResourceRequests.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResourceRequests.java new file mode 100644 index 0000000000000..0b13e33c1e1b9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryResourceRequests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Service Registry. */ +@Immutable +public final class ServiceRegistryResourceRequests { + /* + * Cpu allocated to each Service Registry instance + */ + @JsonProperty(value = "cpu", access = JsonProperty.Access.WRITE_ONLY) + private String cpu; + + /* + * Memory allocated to each Service Registry instance + */ + @JsonProperty(value = "memory", access = JsonProperty.Access.WRITE_ONLY) + private String memory; + + /* + * Instance count of the Service Registry + */ + @JsonProperty(value = "instanceCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer instanceCount; + + /** Creates an instance of ServiceRegistryResourceRequests class. */ + public ServiceRegistryResourceRequests() { + } + + /** + * Get the cpu property: Cpu allocated to each Service Registry instance. + * + * @return the cpu value. + */ + public String cpu() { + return this.cpu; + } + + /** + * Get the memory property: Memory allocated to each Service Registry instance. + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Get the instanceCount property: Instance count of the Service Registry. + * + * @return the instanceCount value. + */ + public Integer instanceCount() { + return this.instanceCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResource.java new file mode 100644 index 0000000000000..0836d060b3a10 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResource.java @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.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.appplatform.generated.fluent.models.ServiceResourceInner; +import java.util.Map; + +/** An immutable client-side representation of ServiceResource. */ +public interface ServiceResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties of the Service resource. + * + * @return the properties value. + */ + ClusterResourceProperties properties(); + + /** + * Gets the sku property: Sku of the Service 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 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.appplatform.generated.fluent.models.ServiceResourceInner object. + * + * @return the inner object. + */ + ServiceResourceInner innerModel(); + + /** The entirety of the ServiceResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The ServiceResource definition stages. */ + interface DefinitionStages { + /** The first stage of the ServiceResource definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the ServiceResource 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 ServiceResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the ServiceResource definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithSku { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServiceResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServiceResource create(Context context); + } + + /** The stage of the ServiceResource 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 ServiceResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the Service resource. + * + * @param properties Properties of the Service resource. + * @return the next definition stage. + */ + WithCreate withProperties(ClusterResourceProperties properties); + } + + /** The stage of the ServiceResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the Service resource. + * + * @param sku Sku of the Service resource. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + } + + /** + * Begins update for the ServiceResource resource. + * + * @return the stage of resource update. + */ + ServiceResource.Update update(); + + /** The template for ServiceResource update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithSku { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServiceResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServiceResource apply(Context context); + } + + /** The ServiceResource update stages. */ + interface UpdateStages { + /** The stage of the ServiceResource 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 ServiceResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the Service resource. + * + * @param properties Properties of the Service resource. + * @return the next definition stage. + */ + Update withProperties(ClusterResourceProperties properties); + } + + /** The stage of the ServiceResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: Sku of the Service resource. + * + * @param sku Sku of the Service resource. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServiceResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServiceResource refresh(Context context); + + /** + * List test keys for a Service. + * + * @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 test keys payload along with {@link Response}. + */ + Response listTestKeysWithResponse(Context context); + + /** + * List test keys for a Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + TestKeys listTestKeys(); + + /** + * Regenerate a test key for a Service. + * + * @param regenerateTestKeyRequest Parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + Response regenerateTestKeyWithResponse( + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, Context context); + + /** + * Regenerate a test key for a Service. + * + * @param regenerateTestKeyRequest Parameters for the 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 test keys payload. + */ + TestKeys regenerateTestKey(RegenerateTestKeyRequestPayload regenerateTestKeyRequest); + + /** + * Disable test endpoint functionality for a Service. + * + * @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 disableTestEndpointWithResponse(Context context); + + /** + * Disable test endpoint functionality for a Service. + * + * @throws com.azure.core.management.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 disableTestEndpoint(); + + /** + * Enable test endpoint functionality for a Service. + * + * @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 test keys payload along with {@link Response}. + */ + Response enableTestEndpointWithResponse(Context context); + + /** + * Enable test endpoint functionality for a Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + TestKeys enableTestEndpoint(); + + /** + * Stop a Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stop a Service. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(Context context); + + /** + * Start a Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Start a Service. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(Context context); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @throws com.azure.core.management.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 flushVnetDnsSetting(); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @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 flushVnetDnsSetting(Context context); + + /** + * List globally enabled APMs for a Service. + * + * @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 globally enabled APMs payload along with {@link Response}. + */ + Response listGloballyEnabledApmsWithResponse(Context context); + + /** + * List globally enabled APMs for a Service. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload. + */ + GloballyEnabledApms listGloballyEnabledApms(); + + /** + * Enable an APM globally. + * + * @param apm The target APM for the enable 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 enableApmGlobally(ApmReference apm); + + /** + * Enable an APM globally. + * + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableApmGlobally(ApmReference apm, Context context); + + /** + * Disable an APM globally. + * + * @param apm The target APM for the disable 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 disableApmGlobally(ApmReference apm); + + /** + * Disable an APM globally. + * + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableApmGlobally(ApmReference apm, Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResourceList.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResourceList.java new file mode 100644 index 0000000000000..f2a6be32d1d2a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResourceList.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Service resources and a possible link for next set. */ +@Fluent +public final class ServiceResourceList { + /* + * Collection of Service resources + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of ServiceResourceList class. */ + public ServiceResourceList() { + } + + /** + * Get the value property: Collection of Service resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of Service resources. + * + * @param value the value value to set. + * @return the ServiceResourceList object itself. + */ + public ServiceResourceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the ServiceResourceList object itself. + */ + public ServiceResourceList 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceSpecification.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceSpecification.java new file mode 100644 index 0000000000000..6b2cbec654792 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification payload. */ +@Fluent +public final class ServiceSpecification { + /* + * Specifications of the Log for Azure Monitoring + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /* + * Specifications of the Metrics for Azure Monitoring + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** Creates an instance of ServiceSpecification class. */ + public ServiceSpecification() { + } + + /** + * Get the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Specifications of the Log for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceVNetAddons.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceVNetAddons.java new file mode 100644 index 0000000000000..92f8b796b8ae7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceVNetAddons.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Additional Service settings in vnet injection instance. */ +@Fluent +public final class ServiceVNetAddons { + /* + * Indicates whether the log stream in vnet injection instance could be accessed from internet. + */ + @JsonProperty(value = "logStreamPublicEndpoint") + private Boolean logStreamPublicEndpoint; + + /* + * Indicates whether the data plane components(log stream, app connect, remote debugging) in vnet injection + * instance could be accessed from internet. + */ + @JsonProperty(value = "dataPlanePublicEndpoint") + private Boolean dataPlanePublicEndpoint; + + /** Creates an instance of ServiceVNetAddons class. */ + public ServiceVNetAddons() { + } + + /** + * Get the logStreamPublicEndpoint property: Indicates whether the log stream in vnet injection instance could be + * accessed from internet. + * + * @return the logStreamPublicEndpoint value. + */ + public Boolean logStreamPublicEndpoint() { + return this.logStreamPublicEndpoint; + } + + /** + * Set the logStreamPublicEndpoint property: Indicates whether the log stream in vnet injection instance could be + * accessed from internet. + * + * @param logStreamPublicEndpoint the logStreamPublicEndpoint value to set. + * @return the ServiceVNetAddons object itself. + */ + public ServiceVNetAddons withLogStreamPublicEndpoint(Boolean logStreamPublicEndpoint) { + this.logStreamPublicEndpoint = logStreamPublicEndpoint; + return this; + } + + /** + * Get the dataPlanePublicEndpoint property: Indicates whether the data plane components(log stream, app connect, + * remote debugging) in vnet injection instance could be accessed from internet. + * + * @return the dataPlanePublicEndpoint value. + */ + public Boolean dataPlanePublicEndpoint() { + return this.dataPlanePublicEndpoint; + } + + /** + * Set the dataPlanePublicEndpoint property: Indicates whether the data plane components(log stream, app connect, + * remote debugging) in vnet injection instance could be accessed from internet. + * + * @param dataPlanePublicEndpoint the dataPlanePublicEndpoint value to set. + * @return the ServiceVNetAddons object itself. + */ + public ServiceVNetAddons withDataPlanePublicEndpoint(Boolean dataPlanePublicEndpoint) { + this.dataPlanePublicEndpoint = dataPlanePublicEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Services.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Services.java new file mode 100644 index 0000000000000..0826b29ac0b1e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Services.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Services. */ +public interface Services { + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * Get a Service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties. + */ + ServiceResource getByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String serviceName); + + /** + * Operation to delete a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, Context context); + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + Response listTestKeysWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * List test keys for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + TestKeys listTestKeys(String resourceGroupName, String serviceName); + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + Response regenerateTestKeyWithResponse( + String resourceGroupName, + String serviceName, + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, + Context context); + + /** + * Regenerate a test key for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param regenerateTestKeyRequest Parameters for the 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 test keys payload. + */ + TestKeys regenerateTestKey( + String resourceGroupName, String serviceName, RegenerateTestKeyRequestPayload regenerateTestKeyRequest); + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response disableTestEndpointWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Disable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableTestEndpoint(String resourceGroupName, String serviceName); + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload along with {@link Response}. + */ + Response enableTestEndpointWithResponse(String resourceGroupName, String serviceName, Context context); + + /** + * Enable test endpoint functionality for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return test keys payload. + */ + TestKeys enableTestEndpoint(String resourceGroupName, String serviceName); + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String serviceName); + + /** + * Stop a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String serviceName, Context context); + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serviceName); + + /** + * Start a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404, 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serviceName, Context context); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void flushVnetDnsSetting(String resourceGroupName, String serviceName); + + /** + * Flush Virtual Network DNS settings for a VNET injected Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void flushVnetDnsSetting(String resourceGroupName, String serviceName, Context context); + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedIterable}. + */ + PagedIterable listSupportedApmTypes(String resourceGroupName, String serviceName); + + /** + * List supported APM types for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported APM types payload as paginated response with {@link PagedIterable}. + */ + PagedIterable listSupportedApmTypes( + String resourceGroupName, String serviceName, Context context); + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload along with {@link Response}. + */ + Response listGloballyEnabledApmsWithResponse( + String resourceGroupName, String serviceName, Context context); + + /** + * List globally enabled APMs for a Service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return globally enabled APMs payload. + */ + GloballyEnabledApms listGloballyEnabledApms(String resourceGroupName, String serviceName); + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable 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 enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm); + + /** + * Enable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the enable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context); + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable 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 disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm); + + /** + * Disable an APM globally. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param apm The target APM for the disable operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableApmGlobally(String resourceGroupName, String serviceName, ApmReference apm, Context context); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return name availability result payload along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters availabilityParameters, Context context); + + /** + * Checks that the resource name is valid and is not already in use. + * + * @param location the region. + * @param availabilityParameters Parameters supplied to the 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 name availability result payload. + */ + NameAvailability checkNameAvailability(String location, NameAvailabilityParameters availabilityParameters); + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Handles requests to list all resources in 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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @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 object that includes an array of Service resources and a possible link for next set as paginated response + * with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listSupportedServerVersions(String resourceGroupName, String serviceName); + + /** + * Lists all of the available server versions supported by Microsoft.AppPlatform provider. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return supported server versions as paginated response with {@link PagedIterable}. + */ + PagedIterable listSupportedServerVersions( + String resourceGroupName, String serviceName, Context context); + + /** + * Get a Service and its properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response}. + */ + ServiceResource getById(String id); + + /** + * Get a Service and its properties. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Service and its properties along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete a Service. + * + * @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); + + /** + * Operation to delete a Service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServiceResource resource. + * + * @param name resource name. + * @return the first stage of the new ServiceResource definition. + */ + ServiceResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SessionAffinity.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SessionAffinity.java new file mode 100644 index 0000000000000..bae39b1ccfc5e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SessionAffinity.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the affinity, set this to Cookie to enable session affinity. */ +public final class SessionAffinity extends ExpandableStringEnum { + /** Static value Cookie for SessionAffinity. */ + public static final SessionAffinity COOKIE = fromString("Cookie"); + + /** Static value None for SessionAffinity. */ + public static final SessionAffinity NONE = fromString("None"); + + /** + * Creates a new instance of SessionAffinity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SessionAffinity() { + } + + /** + * Creates or finds a SessionAffinity from its string representation. + * + * @param name a name to look for. + * @return the corresponding SessionAffinity. + */ + @JsonCreator + public static SessionAffinity fromString(String name) { + return fromString(name, SessionAffinity.class); + } + + /** + * Gets known SessionAffinity values. + * + * @return known SessionAffinity values. + */ + public static Collection values() { + return values(SessionAffinity.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Sku.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Sku.java new file mode 100644 index 0000000000000..3741ee49886de --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Sku.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku of Azure Spring Apps. */ +@Fluent +public final class Sku { + /* + * Name of the Sku + */ + @JsonProperty(value = "name") + private String name; + + /* + * Tier of the Sku + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * Current capacity of the target resource + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** Creates an instance of Sku class. */ + public Sku() { + } + + /** + * Get the name property: Name of the Sku. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Sku. + * + * @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: Tier of the Sku. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: Tier of the Sku. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the capacity property: Current capacity of the target resource. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Current capacity of the target resource. + * + * @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() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuCapacity.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuCapacity.java new file mode 100644 index 0000000000000..64b7e3e03ad3f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuCapacity.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU capacity. */ +@Fluent +public final class SkuCapacity { + /* + * Gets or sets the minimum. + */ + @JsonProperty(value = "minimum", required = true) + private int minimum; + + /* + * Gets or sets the maximum. + */ + @JsonProperty(value = "maximum") + private Integer maximum; + + /* + * Gets or sets the default. + */ + @JsonProperty(value = "default") + private Integer defaultProperty; + + /* + * Gets or sets the type of the scale. + */ + @JsonProperty(value = "scaleType") + private SkuScaleType scaleType; + + /** Creates an instance of SkuCapacity class. */ + public SkuCapacity() { + } + + /** + * Get the minimum property: Gets or sets the minimum. + * + * @return the minimum value. + */ + public int minimum() { + return this.minimum; + } + + /** + * Set the minimum property: Gets or sets the minimum. + * + * @param minimum the minimum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMinimum(int minimum) { + this.minimum = minimum; + return this; + } + + /** + * Get the maximum property: Gets or sets the maximum. + * + * @return the maximum value. + */ + public Integer maximum() { + return this.maximum; + } + + /** + * Set the maximum property: Gets or sets the maximum. + * + * @param maximum the maximum value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withMaximum(Integer maximum) { + this.maximum = maximum; + return this; + } + + /** + * Get the defaultProperty property: Gets or sets the default. + * + * @return the defaultProperty value. + */ + public Integer defaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Gets or sets the default. + * + * @param defaultProperty the defaultProperty value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withDefaultProperty(Integer defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * Get the scaleType property: Gets or sets the type of the scale. + * + * @return the scaleType value. + */ + public SkuScaleType scaleType() { + return this.scaleType; + } + + /** + * Set the scaleType property: Gets or sets the type of the scale. + * + * @param scaleType the scaleType value to set. + * @return the SkuCapacity object itself. + */ + public SkuCapacity withScaleType(SkuScaleType scaleType) { + this.scaleType = scaleType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuObject.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuObject.java new file mode 100644 index 0000000000000..1772fc9b1bc91 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuObject.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource Sku object used for scaling out and scaling in. */ +@Fluent +public final class SkuObject { + /* + * Sku of the Spring Cloud Gateway resource + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** Creates an instance of SkuObject class. */ + public SkuObject() { + } + + /** + * Get the sku property: Sku of the Spring Cloud Gateway resource. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: Sku of the Spring Cloud Gateway resource. + * + * @param sku the sku value to set. + * @return the SkuObject object itself. + */ + public SkuObject withSku(Sku sku) { + this.sku = sku; + 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuScaleType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuScaleType.java new file mode 100644 index 0000000000000..2e4fc720b5e2e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuScaleType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Gets or sets the type of the scale. */ +public final class SkuScaleType extends ExpandableStringEnum { + /** Static value None for SkuScaleType. */ + public static final SkuScaleType NONE = fromString("None"); + + /** Static value Manual for SkuScaleType. */ + public static final SkuScaleType MANUAL = fromString("Manual"); + + /** Static value Automatic for SkuScaleType. */ + public static final SkuScaleType AUTOMATIC = fromString("Automatic"); + + /** + * Creates a new instance of SkuScaleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SkuScaleType() { + } + + /** + * Creates or finds a SkuScaleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SkuScaleType. + */ + @JsonCreator + public static SkuScaleType fromString(String name) { + return fromString(name, SkuScaleType.class); + } + + /** + * Gets known SkuScaleType values. + * + * @return known SkuScaleType values. + */ + public static Collection values() { + return values(SkuScaleType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Skus.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Skus.java new file mode 100644 index 0000000000000..702e18ee7dd15 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Skus.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.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Skus. */ +public interface Skus { + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all of the available skus of the Microsoft.AppPlatform provider. + * + * @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 object that includes an array of Azure Spring Apps SKU and a possible link for next set as paginated + * response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SourceUploadedUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SourceUploadedUserSourceInfo.java new file mode 100644 index 0000000000000..f6e9439b5e13a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SourceUploadedUserSourceInfo.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Uploaded Java source code binary for a deployment. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Source") +@Fluent +public final class SourceUploadedUserSourceInfo extends UploadedUserSourceInfo { + /* + * Selector for the artifact to be used for the deployment for multi-module projects. This should be + * the relative path to the target module/project. + */ + @JsonProperty(value = "artifactSelector") + private String artifactSelector; + + /* + * Runtime version of the source file + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /** Creates an instance of SourceUploadedUserSourceInfo class. */ + public SourceUploadedUserSourceInfo() { + } + + /** + * Get the artifactSelector property: Selector for the artifact to be used for the deployment for multi-module + * projects. This should be the relative path to the target module/project. + * + * @return the artifactSelector value. + */ + public String artifactSelector() { + return this.artifactSelector; + } + + /** + * Set the artifactSelector property: Selector for the artifact to be used for the deployment for multi-module + * projects. This should be the relative path to the target module/project. + * + * @param artifactSelector the artifactSelector value to set. + * @return the SourceUploadedUserSourceInfo object itself. + */ + public SourceUploadedUserSourceInfo withArtifactSelector(String artifactSelector) { + this.artifactSelector = artifactSelector; + return this; + } + + /** + * Get the runtimeVersion property: Runtime version of the source file. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime version of the source file. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the SourceUploadedUserSourceInfo object itself. + */ + public SourceUploadedUserSourceInfo withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** {@inheritDoc} */ + @Override + public SourceUploadedUserSourceInfo withRelativePath(String relativePath) { + super.withRelativePath(relativePath); + return this; + } + + /** {@inheritDoc} */ + @Override + public SourceUploadedUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SsoProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SsoProperties.java new file mode 100644 index 0000000000000..78cc1ed1338ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SsoProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Single sign-on related configuration. */ +@Fluent +public final class SsoProperties { + /* + * It defines the specific actions applications can be allowed to do on a user's behalf + */ + @JsonProperty(value = "scope") + private List scope; + + /* + * The public identifier for the application + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * The secret known only to the application and the authorization server + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * The URI of Issuer Identifier + */ + @JsonProperty(value = "issuerUri") + private String issuerUri; + + /** Creates an instance of SsoProperties class. */ + public SsoProperties() { + } + + /** + * Get the scope property: It defines the specific actions applications can be allowed to do on a user's behalf. + * + * @return the scope value. + */ + public List scope() { + return this.scope; + } + + /** + * Set the scope property: It defines the specific actions applications can be allowed to do on a user's behalf. + * + * @param scope the scope value to set. + * @return the SsoProperties object itself. + */ + public SsoProperties withScope(List scope) { + this.scope = scope; + return this; + } + + /** + * Get the clientId property: The public identifier for the application. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The public identifier for the application. + * + * @param clientId the clientId value to set. + * @return the SsoProperties object itself. + */ + public SsoProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: The secret known only to the application and the authorization server. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: The secret known only to the application and the authorization server. + * + * @param clientSecret the clientSecret value to set. + * @return the SsoProperties object itself. + */ + public SsoProperties withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the issuerUri property: The URI of Issuer Identifier. + * + * @return the issuerUri value. + */ + public String issuerUri() { + return this.issuerUri; + } + + /** + * Set the issuerUri property: The URI of Issuer Identifier. + * + * @param issuerUri the issuerUri value to set. + * @return the SsoProperties object itself. + */ + public SsoProperties withIssuerUri(String issuerUri) { + this.issuerUri = issuerUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StackProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StackProperties.java new file mode 100644 index 0000000000000..b62cf38707e05 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StackProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KPack ClusterStack properties payload. */ +@Fluent +public final class StackProperties { + /* + * Id of the ClusterStack. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Version of the ClusterStack + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of StackProperties class. */ + public StackProperties() { + } + + /** + * Get the id property: Id of the ClusterStack. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of the ClusterStack. + * + * @param id the id value to set. + * @return the StackProperties object itself. + */ + public StackProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the version property: Version of the ClusterStack. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the ClusterStack. + * + * @param version the version value to set. + * @return the StackProperties object itself. + */ + public StackProperties 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageAccount.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageAccount.java new file mode 100644 index 0000000000000..300c028d15124 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageAccount.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** storage resource of type Azure Storage Account. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "storageType") +@JsonTypeName("StorageAccount") +@Fluent +public final class StorageAccount extends StorageProperties { + /* + * The account name of the Azure Storage Account. + */ + @JsonProperty(value = "accountName", required = true) + private String accountName; + + /* + * The account key of the Azure Storage Account. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /** Creates an instance of StorageAccount class. */ + public StorageAccount() { + } + + /** + * Get the accountName property: The account name of the Azure Storage Account. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: The account name of the Azure Storage Account. + * + * @param accountName the accountName value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the accountKey property: The account key of the Azure Storage Account. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: The account key of the Azure Storage Account. + * + * @param accountKey the accountKey value to set. + * @return the StorageAccount object itself. + */ + public StorageAccount withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (accountName() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property accountName in model StorageAccount")); + } + if (accountKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property accountKey in model StorageAccount")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageAccount.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageProperties.java new file mode 100644 index 0000000000000..879e8b6f17f4c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Storage resource payload. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "storageType", + defaultImpl = StorageProperties.class) +@JsonTypeName("StorageProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "StorageAccount", value = StorageAccount.class)}) +@Immutable +public class StorageProperties { + /** Creates an instance of StorageProperties class. */ + public StorageProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResource.java new file mode 100644 index 0000000000000..c9fe4df675a42 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResource.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner; + +/** An immutable client-side representation of StorageResource. */ +public interface StorageResource { + /** + * 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 properties property: Properties of the storage resource payload. + * + * @return the properties value. + */ + StorageProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner object. + * + * @return the inner object. + */ + StorageResourceInner innerModel(); + + /** The entirety of the StorageResource definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** The StorageResource definition stages. */ + interface DefinitionStages { + /** The first stage of the StorageResource definition. */ + interface Blank extends WithParentResource { + } + + /** The stage of the StorageResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, serviceName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @return the next definition stage. + */ + WithCreate withExistingSpring(String resourceGroupName, String serviceName); + } + + /** + * The stage of the StorageResource 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + StorageResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + StorageResource create(Context context); + } + + /** The stage of the StorageResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage resource payload.. + * + * @param properties Properties of the storage resource payload. + * @return the next definition stage. + */ + WithCreate withProperties(StorageProperties properties); + } + } + + /** + * Begins update for the StorageResource resource. + * + * @return the stage of resource update. + */ + StorageResource.Update update(); + + /** The template for StorageResource update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + StorageResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + StorageResource apply(Context context); + } + + /** The StorageResource update stages. */ + interface UpdateStages { + /** The stage of the StorageResource update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage resource payload.. + * + * @param properties Properties of the storage resource payload. + * @return the next definition stage. + */ + Update withProperties(StorageProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + StorageResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + StorageResource refresh(Context context); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResourceCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResourceCollection.java new file mode 100644 index 0000000000000..090debfc124fb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResourceCollection.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection compose of storage resources list and a possible link for next page. */ +@Fluent +public final class StorageResourceCollection { + /* + * The storage resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of storage list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of StorageResourceCollection class. */ + public StorageResourceCollection() { + } + + /** + * Get the value property: The storage resources list. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The storage resources list. + * + * @param value the value value to set. + * @return the StorageResourceCollection object itself. + */ + public StorageResourceCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to next page of storage list. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to next page of storage list. + * + * @param nextLink the nextLink value to set. + * @return the StorageResourceCollection object itself. + */ + public StorageResourceCollection 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageType.java new file mode 100644 index 0000000000000..4b07b5781e331 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the storage. */ +public final class StorageType extends ExpandableStringEnum { + /** Static value StorageAccount for StorageType. */ + public static final StorageType STORAGE_ACCOUNT = fromString("StorageAccount"); + + /** + * Creates a new instance of StorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageType() { + } + + /** + * Creates or finds a StorageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageType. + */ + @JsonCreator + public static StorageType fromString(String name) { + return fromString(name, StorageType.class); + } + + /** + * Gets known StorageType values. + * + * @return known StorageType values. + */ + public static Collection values() { + return values(StorageType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Storages.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Storages.java new file mode 100644 index 0000000000000..e060f1e1f1c5a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Storages.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Storages. */ +public interface Storages { + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String serviceName, String storageName, Context context); + + /** + * Get the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage resource. + */ + StorageResource get(String resourceGroupName, String serviceName, String storageName); + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String storageName); + + /** + * Delete the storage resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param storageName The name of the storage resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String serviceName, String storageName, Context context); + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List all the storages of one Azure Spring Apps resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param serviceName The name of the Service resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection compose of storage resources list and a possible link for next page as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String serviceName, Context context); + + /** + * Get the storage resource. + * + * @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 storage resource along with {@link Response}. + */ + StorageResource getById(String id); + + /** + * Get the storage resource. + * + * @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 storage resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete the storage resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete the storage resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new StorageResource resource. + * + * @param name resource name. + * @return the first stage of the new StorageResource definition. + */ + StorageResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedApmType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedApmType.java new file mode 100644 index 0000000000000..e910cd5f6656a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedApmType.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner; + +/** An immutable client-side representation of SupportedApmType. */ +public interface SupportedApmType { + /** + * Gets the name property: The name of the supported APM type. + * + * @return the name value. + */ + String name(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner object. + * + * @return the inner object. + */ + SupportedApmTypeInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedApmTypes.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedApmTypes.java new file mode 100644 index 0000000000000..826ea2b3b28a2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedApmTypes.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedApmTypeInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Supported APM types payload. */ +@Fluent +public final class SupportedApmTypes { + /* + * Collection of the supported APM type + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SupportedApmTypes class. */ + public SupportedApmTypes() { + } + + /** + * Get the value property: Collection of the supported APM type. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of the supported APM type. + * + * @param value the value value to set. + * @return the SupportedApmTypes object itself. + */ + public SupportedApmTypes withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SupportedApmTypes object itself. + */ + public SupportedApmTypes 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpackResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpackResource.java new file mode 100644 index 0000000000000..728191ad5a40f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpackResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner; + +/** An immutable client-side representation of SupportedBuildpackResource. */ +public interface SupportedBuildpackResource { + /** + * 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 properties property: Supported buildpack resource properties. + * + * @return the properties value. + */ + SupportedBuildpackResourceProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpackResourceInner + * object. + * + * @return the inner object. + */ + SupportedBuildpackResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpackResourceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpackResourceProperties.java new file mode 100644 index 0000000000000..f2bdfeb1b5bcc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpackResourceProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported buildpack resource properties. */ +@Fluent +public final class SupportedBuildpackResourceProperties { + /* + * The id of supported buildpack + */ + @JsonProperty(value = "buildpackId") + private String buildpackId; + + /** Creates an instance of SupportedBuildpackResourceProperties class. */ + public SupportedBuildpackResourceProperties() { + } + + /** + * Get the buildpackId property: The id of supported buildpack. + * + * @return the buildpackId value. + */ + public String buildpackId() { + return this.buildpackId; + } + + /** + * Set the buildpackId property: The id of supported buildpack. + * + * @param buildpackId the buildpackId value to set. + * @return the SupportedBuildpackResourceProperties object itself. + */ + public SupportedBuildpackResourceProperties withBuildpackId(String buildpackId) { + this.buildpackId = buildpackId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpacksCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpacksCollection.java new file mode 100644 index 0000000000000..8a8a0c52a67e7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedBuildpacksCollection.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpacksCollectionInner; +import java.util.List; + +/** An immutable client-side representation of SupportedBuildpacksCollection. */ +public interface SupportedBuildpacksCollection { + /** + * Gets the value property: Collection of supported buildpacks resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedBuildpacksCollectionInner + * object. + * + * @return the inner object. + */ + SupportedBuildpacksCollectionInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimePlatform.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimePlatform.java new file mode 100644 index 0000000000000..de700e2dd9562 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimePlatform.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The platform of this runtime version (possible values: "Java" or ".NET"). */ +public final class SupportedRuntimePlatform extends ExpandableStringEnum { + /** Static value Java for SupportedRuntimePlatform. */ + public static final SupportedRuntimePlatform JAVA = fromString("Java"); + + /** Static value .NET Core for SupportedRuntimePlatform. */ + public static final SupportedRuntimePlatform NET_CORE = fromString(".NET Core"); + + /** + * Creates a new instance of SupportedRuntimePlatform value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportedRuntimePlatform() { + } + + /** + * Creates or finds a SupportedRuntimePlatform from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportedRuntimePlatform. + */ + @JsonCreator + public static SupportedRuntimePlatform fromString(String name) { + return fromString(name, SupportedRuntimePlatform.class); + } + + /** + * Gets known SupportedRuntimePlatform values. + * + * @return known SupportedRuntimePlatform values. + */ + public static Collection values() { + return values(SupportedRuntimePlatform.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeValue.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeValue.java new file mode 100644 index 0000000000000..b056744888b6a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeValue.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The raw value which could be passed to deployment CRUD operations. */ +public final class SupportedRuntimeValue extends ExpandableStringEnum { + /** Static value Java_8 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue JAVA_8 = fromString("Java_8"); + + /** Static value Java_11 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue JAVA_11 = fromString("Java_11"); + + /** Static value Java_17 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue JAVA_17 = fromString("Java_17"); + + /** Static value NetCore_31 for SupportedRuntimeValue. */ + public static final SupportedRuntimeValue NET_CORE_31 = fromString("NetCore_31"); + + /** + * Creates a new instance of SupportedRuntimeValue value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportedRuntimeValue() { + } + + /** + * Creates or finds a SupportedRuntimeValue from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportedRuntimeValue. + */ + @JsonCreator + public static SupportedRuntimeValue fromString(String name) { + return fromString(name, SupportedRuntimeValue.class); + } + + /** + * Gets known SupportedRuntimeValue values. + * + * @return known SupportedRuntimeValue values. + */ + public static Collection values() { + return values(SupportedRuntimeValue.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeVersion.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeVersion.java new file mode 100644 index 0000000000000..b4abfaca35a47 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeVersion.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported deployment runtime version descriptor. */ +@Fluent +public final class SupportedRuntimeVersion { + /* + * The raw value which could be passed to deployment CRUD operations. + */ + @JsonProperty(value = "value") + private SupportedRuntimeValue value; + + /* + * The platform of this runtime version (possible values: "Java" or ".NET"). + */ + @JsonProperty(value = "platform") + private SupportedRuntimePlatform platform; + + /* + * The detailed version (major.minor) of the platform. + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of SupportedRuntimeVersion class. */ + public SupportedRuntimeVersion() { + } + + /** + * Get the value property: The raw value which could be passed to deployment CRUD operations. + * + * @return the value value. + */ + public SupportedRuntimeValue value() { + return this.value; + } + + /** + * Set the value property: The raw value which could be passed to deployment CRUD operations. + * + * @param value the value value to set. + * @return the SupportedRuntimeVersion object itself. + */ + public SupportedRuntimeVersion withValue(SupportedRuntimeValue value) { + this.value = value; + return this; + } + + /** + * Get the platform property: The platform of this runtime version (possible values: "Java" or ".NET"). + * + * @return the platform value. + */ + public SupportedRuntimePlatform platform() { + return this.platform; + } + + /** + * Set the platform property: The platform of this runtime version (possible values: "Java" or ".NET"). + * + * @param platform the platform value to set. + * @return the SupportedRuntimeVersion object itself. + */ + public SupportedRuntimeVersion withPlatform(SupportedRuntimePlatform platform) { + this.platform = platform; + return this; + } + + /** + * Get the version property: The detailed version (major.minor) of the platform. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The detailed version (major.minor) of the platform. + * + * @param version the version value to set. + * @return the SupportedRuntimeVersion object itself. + */ + public SupportedRuntimeVersion 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedServerVersion.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedServerVersion.java new file mode 100644 index 0000000000000..f32f09bf1e856 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedServerVersion.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner; + +/** An immutable client-side representation of SupportedServerVersion. */ +public interface SupportedServerVersion { + /** + * Gets the value property: The raw server version value which could be passed to deployment CRUD operations. + * + * @return the value value. + */ + String value(); + + /** + * Gets the server property: The server name. + * + * @return the server value. + */ + String server(); + + /** + * Gets the version property: The Server version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner object. + * + * @return the inner object. + */ + SupportedServerVersionInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedServerVersions.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedServerVersions.java new file mode 100644 index 0000000000000..f51e2991bb727 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedServerVersions.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedServerVersionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Supported server versions. */ +@Fluent +public final class SupportedServerVersions { + /* + * Collection of the supported server versions. + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SupportedServerVersions class. */ + public SupportedServerVersions() { + } + + /** + * Get the value property: Collection of the supported server versions. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of the supported server versions. + * + * @param value the value value to set. + * @return the SupportedServerVersions object itself. + */ + public SupportedServerVersions withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SupportedServerVersions object itself. + */ + public SupportedServerVersions 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStackResource.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStackResource.java new file mode 100644 index 0000000000000..af0efd0f575fb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStackResource.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.appplatform.generated.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner; + +/** An immutable client-side representation of SupportedStackResource. */ +public interface SupportedStackResource { + /** + * 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 properties property: Supported stack resource properties. + * + * @return the properties value. + */ + SupportedStackResourceProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStackResourceInner object. + * + * @return the inner object. + */ + SupportedStackResourceInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStackResourceProperties.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStackResourceProperties.java new file mode 100644 index 0000000000000..f30ccf6fd09c9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStackResourceProperties.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported stack resource properties. */ +@Fluent +public final class SupportedStackResourceProperties { + /* + * The id of supported stack + */ + @JsonProperty(value = "stackId") + private String stackId; + + /* + * The version of supported stack + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of SupportedStackResourceProperties class. */ + public SupportedStackResourceProperties() { + } + + /** + * Get the stackId property: The id of supported stack. + * + * @return the stackId value. + */ + public String stackId() { + return this.stackId; + } + + /** + * Set the stackId property: The id of supported stack. + * + * @param stackId the stackId value to set. + * @return the SupportedStackResourceProperties object itself. + */ + public SupportedStackResourceProperties withStackId(String stackId) { + this.stackId = stackId; + return this; + } + + /** + * Get the version property: The version of supported stack. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of supported stack. + * + * @param version the version value to set. + * @return the SupportedStackResourceProperties object itself. + */ + public SupportedStackResourceProperties 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStacksCollection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStacksCollection.java new file mode 100644 index 0000000000000..a0d3348575602 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedStacksCollection.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStacksCollectionInner; +import java.util.List; + +/** An immutable client-side representation of SupportedStacksCollection. */ +public interface SupportedStacksCollection { + /** + * Gets the value property: Collection of supported stacks resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.SupportedStacksCollectionInner + * object. + * + * @return the inner object. + */ + SupportedStacksCollectionInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TcpScaleRule.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TcpScaleRule.java new file mode 100644 index 0000000000000..99d5bd3527412 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TcpScaleRule.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Azure Spring Apps App Instance Tcp scaling rule. */ +@Fluent +public final class TcpScaleRule { + /* + * Metadata properties to describe tcp scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the tcp scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** Creates an instance of TcpScaleRule class. */ + public TcpScaleRule() { + } + + /** + * Get the metadata property: Metadata properties to describe tcp scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe tcp scale rule. + * + * @param metadata the metadata value to set. + * @return the TcpScaleRule object itself. + */ + public TcpScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the tcp scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the tcp scale rule. + * + * @param auth the auth value to set. + * @return the TcpScaleRule object itself. + */ + public TcpScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TcpSocketAction.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TcpSocketAction.java new file mode 100644 index 0000000000000..3180d1aa897a3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TcpSocketAction.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** TCPSocketAction describes an action based on opening a socket. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("TCPSocketAction") +@Immutable +public final class TcpSocketAction extends ProbeAction { + /** Creates an instance of TcpSocketAction class. */ + public TcpSocketAction() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TemporaryDisk.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TemporaryDisk.java new file mode 100644 index 0000000000000..bf7a637efc4fe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TemporaryDisk.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Temporary disk payload. */ +@Fluent +public final class TemporaryDisk { + /* + * Size of the temporary disk in GB + */ + @JsonProperty(value = "sizeInGB") + private Integer sizeInGB; + + /* + * Mount path of the temporary disk + */ + @JsonProperty(value = "mountPath") + private String mountPath; + + /** Creates an instance of TemporaryDisk class. */ + public TemporaryDisk() { + } + + /** + * Get the sizeInGB property: Size of the temporary disk in GB. + * + * @return the sizeInGB value. + */ + public Integer sizeInGB() { + return this.sizeInGB; + } + + /** + * Set the sizeInGB property: Size of the temporary disk in GB. + * + * @param sizeInGB the sizeInGB value to set. + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withSizeInGB(Integer sizeInGB) { + this.sizeInGB = sizeInGB; + return this; + } + + /** + * Get the mountPath property: Mount path of the temporary disk. + * + * @return the mountPath value. + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the mountPath property: Mount path of the temporary disk. + * + * @param mountPath the mountPath value to set. + * @return the TemporaryDisk object itself. + */ + public TemporaryDisk withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeyType.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeyType.java new file mode 100644 index 0000000000000..0503de2215df4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeyType.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of the test key. */ +public final class TestKeyType extends ExpandableStringEnum { + /** Static value Primary for TestKeyType. */ + public static final TestKeyType PRIMARY = fromString("Primary"); + + /** Static value Secondary for TestKeyType. */ + public static final TestKeyType SECONDARY = fromString("Secondary"); + + /** + * Creates a new instance of TestKeyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TestKeyType() { + } + + /** + * Creates or finds a TestKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestKeyType. + */ + @JsonCreator + public static TestKeyType fromString(String name) { + return fromString(name, TestKeyType.class); + } + + /** + * Gets known TestKeyType values. + * + * @return known TestKeyType values. + */ + public static Collection values() { + return values(TestKeyType.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeys.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeys.java new file mode 100644 index 0000000000000..1ecc043f1250e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeys.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.appplatform.generated.models; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; + +/** An immutable client-side representation of TestKeys. */ +public interface TestKeys { + /** + * Gets the primaryKey property: Primary key. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: Secondary key. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the primaryTestEndpoint property: Primary test endpoint. + * + * @return the primaryTestEndpoint value. + */ + String primaryTestEndpoint(); + + /** + * Gets the secondaryTestEndpoint property: Secondary test endpoint. + * + * @return the secondaryTestEndpoint value. + */ + String secondaryTestEndpoint(); + + /** + * Gets the enabled property: Indicates whether the test endpoint feature enabled or not. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the inner com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner object. + * + * @return the inner object. + */ + TestKeysInner innerModel(); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TrafficDirection.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TrafficDirection.java new file mode 100644 index 0000000000000..cb2759ea6176e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TrafficDirection.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The direction of required traffic. */ +public final class TrafficDirection extends ExpandableStringEnum { + /** Static value Inbound for TrafficDirection. */ + public static final TrafficDirection INBOUND = fromString("Inbound"); + + /** Static value Outbound for TrafficDirection. */ + public static final TrafficDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of TrafficDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrafficDirection() { + } + + /** + * Creates or finds a TrafficDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrafficDirection. + */ + @JsonCreator + public static TrafficDirection fromString(String name) { + return fromString(name, TrafficDirection.class); + } + + /** + * Gets known TrafficDirection values. + * + * @return known TrafficDirection values. + */ + public static Collection values() { + return values(TrafficDirection.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TriggeredBuildResult.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TriggeredBuildResult.java new file mode 100644 index 0000000000000..eba3872659965 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TriggeredBuildResult.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The build result triggered by a build. */ +@Fluent +public final class TriggeredBuildResult { + /* + * The unique build id of this build result + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of TriggeredBuildResult class. */ + public TriggeredBuildResult() { + } + + /** + * Get the id property: The unique build id of this build result. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The unique build id of this build result. + * + * @param id the id value to set. + * @return the TriggeredBuildResult object itself. + */ + public TriggeredBuildResult withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Type.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Type.java new file mode 100644 index 0000000000000..1fd1ddd02683a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Type.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of the underlying resource to mount as a persistent disk. */ +public final class Type extends ExpandableStringEnum { + /** Static value AzureFileVolume for Type. */ + public static final Type AZURE_FILE_VOLUME = fromString("AzureFileVolume"); + + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + + /** + * Creates or finds a Type from its string representation. + * + * @param name a name to look for. + * @return the corresponding Type. + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * Gets known Type values. + * + * @return known Type values. + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UploadedUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UploadedUserSourceInfo.java new file mode 100644 index 0000000000000..7bff31278c0de --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UploadedUserSourceInfo.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Source with uploaded location. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = UploadedUserSourceInfo.class) +@JsonTypeName("UploadedUserSourceInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Jar", value = JarUploadedUserSourceInfo.class), + @JsonSubTypes.Type(name = "War", value = WarUploadedUserSourceInfo.class), + @JsonSubTypes.Type(name = "Source", value = SourceUploadedUserSourceInfo.class), + @JsonSubTypes.Type(name = "NetCoreZip", value = NetCoreZipUploadedUserSourceInfo.class) +}) +@Fluent +public class UploadedUserSourceInfo extends UserSourceInfo { + /* + * Relative path of the storage which stores the source + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** Creates an instance of UploadedUserSourceInfo class. */ + public UploadedUserSourceInfo() { + } + + /** + * Get the relativePath property: Relative path of the storage which stores the source. + * + * @return the relativePath value. + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath property: Relative path of the storage which stores the source. + * + * @param relativePath the relativePath value to set. + * @return the UploadedUserSourceInfo object itself. + */ + public UploadedUserSourceInfo withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + + /** {@inheritDoc} */ + @Override + public UploadedUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UserAssignedManagedIdentity.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UserAssignedManagedIdentity.java new file mode 100644 index 0000000000000..63884d3194b67 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UserAssignedManagedIdentity.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.appplatform.generated.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The details of the user-assigned managed identity assigned to an App. */ +@Immutable +public final class UserAssignedManagedIdentity { + /* + * Principal Id of user-assigned managed identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * Client Id of user-assigned managed identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** Creates an instance of UserAssignedManagedIdentity class. */ + public UserAssignedManagedIdentity() { + } + + /** + * Get the principalId property: Principal Id of user-assigned managed identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: Client Id of user-assigned managed identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UserSourceInfo.java new file mode 100644 index 0000000000000..60eb2fd75812d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UserSourceInfo.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Source information for a deployment. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = UserSourceInfo.class) +@JsonTypeName("UserSourceInfo") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "UploadedUserSourceInfo", value = UploadedUserSourceInfo.class), + @JsonSubTypes.Type(name = "BuildResult", value = BuildResultUserSourceInfo.class), + @JsonSubTypes.Type(name = "Container", value = CustomContainerUserSourceInfo.class) +}) +@Fluent +public class UserSourceInfo { + /* + * Version of the source + */ + @JsonProperty(value = "version") + private String version; + + /** Creates an instance of UserSourceInfo class. */ + public UserSourceInfo() { + } + + /** + * Get the version property: Version of the source. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Version of the source. + * + * @param version the version value to set. + * @return the UserSourceInfo object itself. + */ + public UserSourceInfo 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/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ValidationMessages.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ValidationMessages.java new file mode 100644 index 0000000000000..87137f48af42e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ValidationMessages.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validate messages of the configuration service git repositories. */ +@Fluent +public final class ValidationMessages { + /* + * The name of the configuration service git repository. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Detailed validation messages. + */ + @JsonProperty(value = "messages") + private List messages; + + /** Creates an instance of ValidationMessages class. */ + public ValidationMessages() { + } + + /** + * Get the name property: The name of the configuration service git repository. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the configuration service git repository. + * + * @param name the name value to set. + * @return the ValidationMessages object itself. + */ + public ValidationMessages withName(String name) { + this.name = name; + return this; + } + + /** + * Get the messages property: Detailed validation messages. + * + * @return the messages value. + */ + public List messages() { + return this.messages; + } + + /** + * Set the messages property: Detailed validation messages. + * + * @param messages the messages value to set. + * @return the ValidationMessages object itself. + */ + public ValidationMessages withMessages(List messages) { + this.messages = messages; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WarUploadedUserSourceInfo.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WarUploadedUserSourceInfo.java new file mode 100644 index 0000000000000..3bafbd85cc5dc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WarUploadedUserSourceInfo.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.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Uploaded War binary for a deployment. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("War") +@Fluent +public final class WarUploadedUserSourceInfo extends UploadedUserSourceInfo { + /* + * Runtime version of the war file + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /* + * JVM parameter + */ + @JsonProperty(value = "jvmOptions") + private String jvmOptions; + + /* + * Server version, currently only Apache Tomcat is supported + */ + @JsonProperty(value = "serverVersion") + private String serverVersion; + + /** Creates an instance of WarUploadedUserSourceInfo class. */ + public WarUploadedUserSourceInfo() { + } + + /** + * Get the runtimeVersion property: Runtime version of the war file. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime version of the war file. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the WarUploadedUserSourceInfo object itself. + */ + public WarUploadedUserSourceInfo withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Get the jvmOptions property: JVM parameter. + * + * @return the jvmOptions value. + */ + public String jvmOptions() { + return this.jvmOptions; + } + + /** + * Set the jvmOptions property: JVM parameter. + * + * @param jvmOptions the jvmOptions value to set. + * @return the WarUploadedUserSourceInfo object itself. + */ + public WarUploadedUserSourceInfo withJvmOptions(String jvmOptions) { + this.jvmOptions = jvmOptions; + return this; + } + + /** + * Get the serverVersion property: Server version, currently only Apache Tomcat is supported. + * + * @return the serverVersion value. + */ + public String serverVersion() { + return this.serverVersion; + } + + /** + * Set the serverVersion property: Server version, currently only Apache Tomcat is supported. + * + * @param serverVersion the serverVersion value to set. + * @return the WarUploadedUserSourceInfo object itself. + */ + public WarUploadedUserSourceInfo withServerVersion(String serverVersion) { + this.serverVersion = serverVersion; + return this; + } + + /** {@inheritDoc} */ + @Override + public WarUploadedUserSourceInfo withRelativePath(String relativePath) { + super.withRelativePath(relativePath); + return this; + } + + /** {@inheritDoc} */ + @Override + public WarUploadedUserSourceInfo withVersion(String version) { + super.withVersion(version); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WeekDay.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WeekDay.java new file mode 100644 index 0000000000000..1fb75b54d1da5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WeekDay.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.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The day to run the maintenance job. */ +public final class WeekDay extends ExpandableStringEnum { + /** Static value Monday for WeekDay. */ + public static final WeekDay MONDAY = fromString("Monday"); + + /** Static value Tuesday for WeekDay. */ + public static final WeekDay TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for WeekDay. */ + public static final WeekDay WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for WeekDay. */ + public static final WeekDay THURSDAY = fromString("Thursday"); + + /** Static value Friday for WeekDay. */ + public static final WeekDay FRIDAY = fromString("Friday"); + + /** Static value Saturday for WeekDay. */ + public static final WeekDay SATURDAY = fromString("Saturday"); + + /** Static value Sunday for WeekDay. */ + public static final WeekDay SUNDAY = fromString("Sunday"); + + /** + * Creates a new instance of WeekDay value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WeekDay() { + } + + /** + * Creates or finds a WeekDay from its string representation. + * + * @param name a name to look for. + * @return the corresponding WeekDay. + */ + @JsonCreator + public static WeekDay fromString(String name) { + return fromString(name, WeekDay.class); + } + + /** + * Gets known WeekDay values. + * + * @return known WeekDay values. + */ + public static Collection values() { + return values(WeekDay.class); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WeeklyMaintenanceScheduleConfiguration.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WeeklyMaintenanceScheduleConfiguration.java new file mode 100644 index 0000000000000..bc5b258a57d7f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/WeeklyMaintenanceScheduleConfiguration.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Weekly planned maintenance. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "frequency") +@JsonTypeName("Weekly") +@Fluent +public final class WeeklyMaintenanceScheduleConfiguration extends MaintenanceScheduleConfiguration { + /* + * The hour to run the maintenance job + */ + @JsonProperty(value = "hour", required = true) + private int hour; + + /* + * The duration time to run the maintenance job, specified in ISO8601 format, e.g. PT8H + */ + @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY) + private String duration; + + /* + * The day to run the maintenance job + */ + @JsonProperty(value = "day", required = true) + private WeekDay day; + + /** Creates an instance of WeeklyMaintenanceScheduleConfiguration class. */ + public WeeklyMaintenanceScheduleConfiguration() { + } + + /** + * Get the hour property: The hour to run the maintenance job. + * + * @return the hour value. + */ + public int hour() { + return this.hour; + } + + /** + * Set the hour property: The hour to run the maintenance job. + * + * @param hour the hour value to set. + * @return the WeeklyMaintenanceScheduleConfiguration object itself. + */ + public WeeklyMaintenanceScheduleConfiguration withHour(int hour) { + this.hour = hour; + return this; + } + + /** + * Get the duration property: The duration time to run the maintenance job, specified in ISO8601 format, e.g. PT8H. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the day property: The day to run the maintenance job. + * + * @return the day value. + */ + public WeekDay day() { + return this.day; + } + + /** + * Set the day property: The day to run the maintenance job. + * + * @param day the day value to set. + * @return the WeeklyMaintenanceScheduleConfiguration object itself. + */ + public WeeklyMaintenanceScheduleConfiguration withDay(WeekDay day) { + this.day = day; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (day() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property day in model WeeklyMaintenanceScheduleConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WeeklyMaintenanceScheduleConfiguration.class); +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/package-info.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/package-info.java new file mode 100644 index 0000000000000..ab3e826408151 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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 AppPlatformManagementClient. REST API for Azure Spring Apps. */ +package com.azure.resourcemanager.appplatform.generated.models; diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/package-info.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/package-info.java new file mode 100644 index 0000000000000..2110ed48eaf4f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/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 AppPlatformManagementClient. REST API for Azure Spring Apps. */ +package com.azure.resourcemanager.appplatform.generated; diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/module-info.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/module-info.java new file mode 100644 index 0000000000000..ab1aa3a5e7572 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/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.appplatform.generated { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.appplatform.generated; + exports com.azure.resourcemanager.appplatform.generated.fluent; + exports com.azure.resourcemanager.appplatform.generated.fluent.models; + exports com.azure.resourcemanager.appplatform.generated.models; + + opens com.azure.resourcemanager.appplatform.generated.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.appplatform.generated.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d41cc7fa054e2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainProperties; + +/** Samples for ApiPortalCustomDomains CreateOrUpdate. */ +public final class ApiPortalCustomDomainsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json + */ + /** + * Sample code: ApiPortalCustomDomains_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .define("myDomainName") + .withExistingApiPortal("myResourceGroup", "myservice", "default") + .withProperties(new ApiPortalCustomDomainProperties().withThumbprint("*")) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsDeleteSamples.java new file mode 100644 index 0000000000000..9e5d5b947df99 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ApiPortalCustomDomains Delete. */ +public final class ApiPortalCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_Delete.json + */ + /** + * Sample code: ApiPortalCustomDomains_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .delete("myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsGetSamples.java new file mode 100644 index 0000000000000..496d0b69de8f8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for ApiPortalCustomDomains Get. */ +public final class ApiPortalCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_Get.json + */ + /** + * Sample code: ApiPortalCustomDomains_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .getWithResponse( + "myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsListSamples.java new file mode 100644 index 0000000000000..0bbbd5d7103bd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsListSamples.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.appplatform.generated.generated; + +/** Samples for ApiPortalCustomDomains List. */ +public final class ApiPortalCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortalCustomDomains_List.json + */ + /** + * Sample code: ApiPortalCustomDomains_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalCustomDomainsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortalCustomDomains() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f492e8047f729 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsCreateOrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.Arrays; + +/** Samples for ApiPortals CreateOrUpdate. */ +public final class ApiPortalsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_CreateOrUpdate.json + */ + /** + * Sample code: ApiPortals_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortals() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new ApiPortalProperties() + .withPublicProperty(true) + .withGatewayIds( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default"))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsDeleteSamples.java new file mode 100644 index 0000000000000..8881e55036600 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ApiPortals Delete. */ +public final class ApiPortalsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_Delete.json + */ + /** + * Sample code: ApiPortals_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apiPortals().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsGetSamples.java new file mode 100644 index 0000000000000..8b9e0ff9704f6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsGetSamples.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.appplatform.generated.generated; + +/** Samples for ApiPortals Get. */ +public final class ApiPortalsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_Get.json + */ + /** + * Sample code: ApiPortals_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortals() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsListSamples.java new file mode 100644 index 0000000000000..1561be5cfdaa1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsListSamples.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.appplatform.generated.generated; + +/** Samples for ApiPortals List. */ +public final class ApiPortalsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_List.json + */ + /** + * Sample code: ApiPortals_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apiPortals().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsValidateDomainSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsValidateDomainSamples.java new file mode 100644 index 0000000000000..433460bf407b2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsValidateDomainSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** Samples for ApiPortals ValidateDomain. */ +public final class ApiPortalsValidateDomainSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApiPortals_ValidateDomain.json + */ + /** + * Sample code: ApiPortals_ValidateDomain. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apiPortalsValidateDomain( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apiPortals() + .validateDomainWithResponse( + "myResourceGroup", + "myservice", + "default", + new CustomDomainValidatePayload().withName("mydomain.io"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..8e8bb8b30cca7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApmProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Apms CreateOrUpdate. */ +public final class ApmsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_CreateOrUpdate.json + */ + /** + * Sample code: Apms_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsCreateOrUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apms() + .define("myappinsights") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new ApmProperties() + .withType("ApplicationInsights") + .withProperties(mapOf("any-string", "any-string", "sampling-rate", "12.0")) + .withSecrets( + mapOf( + "connection-string", + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsDeleteSamples.java new file mode 100644 index 0000000000000..5af625167107c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Apms Delete. */ +public final class ApmsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_Delete.json + */ + /** + * Sample code: Apms_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apms().delete("myResourceGroup", "myservice", "myappinsights", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsGetSamples.java new file mode 100644 index 0000000000000..782a715d01d20 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsGetSamples.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.appplatform.generated.generated; + +/** Samples for Apms Get. */ +public final class ApmsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_Get.json + */ + /** + * Sample code: Apms_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apms() + .getWithResponse("myResourceGroup", "myservice", "myappinsights", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsListSamples.java new file mode 100644 index 0000000000000..68be8c10db147 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsListSamples.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.appplatform.generated.generated; + +/** Samples for Apms List. */ +public final class ApmsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_List.json + */ + /** + * Sample code: Apms_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apms().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsListSecretKeysSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsListSecretKeysSamples.java new file mode 100644 index 0000000000000..207ebe9f236be --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApmsListSecretKeysSamples.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.appplatform.generated.generated; + +/** Samples for Apms ListSecretKeys. */ +public final class ApmsListSecretKeysSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apms_ListSecretKeys.json + */ + /** + * Sample code: Apms_ListSecretKeys. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void apmsListSecretKeys(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apms() + .listSecretKeysWithResponse( + "myResourceGroup", "myservice", "myappinsights", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..6331859c55de5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApplicationAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +/** Samples for ApplicationAccelerators CreateOrUpdate. */ +public final class ApplicationAcceleratorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_CreateOrUpdate.json + */ + /** + * Sample code: ApplicationAccelerators_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationAccelerators() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties(new ApplicationAcceleratorProperties()) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsDeleteSamples.java new file mode 100644 index 0000000000000..fc0de6362547e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ApplicationAccelerators Delete. */ +public final class ApplicationAcceleratorsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_Delete.json + */ + /** + * Sample code: ApplicationAccelerators_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationAccelerators() + .delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsGetSamples.java new file mode 100644 index 0000000000000..63fe1f2a619d6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsGetSamples.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.appplatform.generated.generated; + +/** Samples for ApplicationAccelerators Get. */ +public final class ApplicationAcceleratorsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_Get.json + */ + /** + * Sample code: ApplicationAccelerators_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationAccelerators() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsListSamples.java new file mode 100644 index 0000000000000..81ae71b20d4f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationAcceleratorsListSamples.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.appplatform.generated.generated; + +/** Samples for ApplicationAccelerators List. */ +public final class ApplicationAcceleratorsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationAccelerators_List.json + */ + /** + * Sample code: ApplicationAccelerators_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationAcceleratorsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.applicationAccelerators().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..71b6fe965d71c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApplicationLiveViewProperties; + +/** Samples for ApplicationLiveViews CreateOrUpdate. */ +public final class ApplicationLiveViewsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveViews_CreateOrUpdate.json + */ + /** + * Sample code: ApplicationLiveViews_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationLiveViews() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties(new ApplicationLiveViewProperties()) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsDeleteSamples.java new file mode 100644 index 0000000000000..17a1b87d397db --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ApplicationLiveViews Delete. */ +public final class ApplicationLiveViewsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveView_Delete.json + */ + /** + * Sample code: ApplicationLiveViews_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationLiveViews() + .delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsGetSamples.java new file mode 100644 index 0000000000000..9d7d97c2e5a3d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsGetSamples.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.appplatform.generated.generated; + +/** Samples for ApplicationLiveViews Get. */ +public final class ApplicationLiveViewsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveViews_Get.json + */ + /** + * Sample code: ApplicationLiveViews_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .applicationLiveViews() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsListSamples.java new file mode 100644 index 0000000000000..aeb6d7c4832cf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApplicationLiveViewsListSamples.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.appplatform.generated.generated; + +/** Samples for ApplicationLiveViews List. */ +public final class ApplicationLiveViewsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ApplicationLiveViews_List.json + */ + /** + * Sample code: ApplicationLiveViews_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void applicationLiveViewsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.applicationLiveViews().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2358530a79fc7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsCreateOrUpdateSamples.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.AppVNetAddons; +import com.azure.resourcemanager.appplatform.generated.models.AzureFileVolume; +import com.azure.resourcemanager.appplatform.generated.models.CustomPersistentDiskResource; +import com.azure.resourcemanager.appplatform.generated.models.LoadedCertificate; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityType; +import com.azure.resourcemanager.appplatform.generated.models.PersistentDisk; +import com.azure.resourcemanager.appplatform.generated.models.TemporaryDisk; +import com.azure.resourcemanager.appplatform.generated.models.UserAssignedManagedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Apps CreateOrUpdate. */ +public final class AppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_CreateOrUpdate.json + */ + /** + * Sample code: Apps_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsCreateOrUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .define("myapp") + .withExistingSpring("myResourceGroup", "myservice") + .withRegion("eastus") + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs"), + "ServiceRegistry", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry"))) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withEnableSubPath(true) + .withMountOptions( + Arrays.asList("uid=0", "gid=0", "dir_mode=0777", "file_mode=0777")) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false) + .withLoadedCertificates( + Arrays + .asList( + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1") + .withLoadTrustStore(false), + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2") + .withLoadTrustStore(true))) + .withWorkloadProfileName("dedicated1")) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_CreateOrUpdate_VNetInjection.json + */ + /** + * Sample code: Apps_CreateOrUpdate_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsCreateOrUpdateVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .define("myapp") + .withExistingSpring("myResourceGroup", "myservice") + .withRegion("eastus") + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs"), + "ServiceRegistry", + mapOf( + "resourceId", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry"))) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withMountOptions( + Arrays.asList("uid=0", "gid=0", "dir_mode=0777", "file_mode=0777")) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false) + .withLoadedCertificates( + Arrays + .asList( + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1") + .withLoadTrustStore(false), + new LoadedCertificate() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2") + .withLoadTrustStore(true))) + .withVnetAddons(new AppVNetAddons().withPublicEndpoint(true))) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsDeleteSamples.java new file mode 100644 index 0000000000000..c45dab47c6a44 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Apps Delete. */ +public final class AppsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Delete.json + */ + /** + * Sample code: Apps_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().delete("myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetResourceUploadUrlSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetResourceUploadUrlSamples.java new file mode 100644 index 0000000000000..2c05d9feccbe4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetResourceUploadUrlSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for Apps GetResourceUploadUrl. */ +public final class AppsGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_GetResourceUploadUrl.json + */ + /** + * Sample code: Apps_GetResourceUploadUrl. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsGetResourceUploadUrl( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .getResourceUploadUrlWithResponse( + "myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetSamples.java new file mode 100644 index 0000000000000..cdab35786a20f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetSamples.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.appplatform.generated.generated; + +/** Samples for Apps Get. */ +public final class AppsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Get_VNetInjection.json + */ + /** + * Sample code: Apps_Get_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsGetVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Get.json + */ + /** + * Sample code: Apps_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsListSamples.java new file mode 100644 index 0000000000000..9a06c1ce35299 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsListSamples.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.appplatform.generated.generated; + +/** Samples for Apps List. */ +public final class AppsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_List.json + */ + /** + * Sample code: Apps_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_List_VNetInjection.json + */ + /** + * Sample code: Apps_List_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsListVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.apps().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsSetActiveDeploymentsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsSetActiveDeploymentsSamples.java new file mode 100644 index 0000000000000..2bad2a37e46d6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsSetActiveDeploymentsSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ActiveDeploymentCollection; +import java.util.Arrays; + +/** Samples for Apps SetActiveDeployments. */ +public final class AppsSetActiveDeploymentsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_SetActiveDeployments.json + */ + /** + * Sample code: Apps_SetActiveDeployments. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsSetActiveDeployments( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .setActiveDeployments( + "myResourceGroup", + "myservice", + "myapp", + new ActiveDeploymentCollection().withActiveDeploymentNames(Arrays.asList("default")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsUpdateSamples.java new file mode 100644 index 0000000000000..b4a1f060403e2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsUpdateSamples.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.AppResource; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.AppVNetAddons; +import com.azure.resourcemanager.appplatform.generated.models.AzureFileVolume; +import com.azure.resourcemanager.appplatform.generated.models.CustomPersistentDiskResource; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityType; +import com.azure.resourcemanager.appplatform.generated.models.PersistentDisk; +import com.azure.resourcemanager.appplatform.generated.models.TemporaryDisk; +import com.azure.resourcemanager.appplatform.generated.models.UserAssignedManagedIdentity; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Apps Update. */ +public final class AppsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Update_VNetInjection.json + */ + /** + * Sample code: Apps_Update_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsUpdateVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + AppResource resource = + manager + .apps() + .getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withMountOptions(Arrays.asList()) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false) + .withVnetAddons(new AppVNetAddons().withPublicEndpoint(true))) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .apply(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_Update.json + */ + /** + * Sample code: Apps_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + AppResource resource = + manager + .apps() + .getWithResponse("myResourceGroup", "myservice", "myapp", null, com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withHttpsOnly(false) + .withTemporaryDisk(new TemporaryDisk().withSizeInGB(2).withMountPath("/mytemporarydisk")) + .withPersistentDisk(new PersistentDisk().withSizeInGB(2).withMountPath("/mypersistentdisk")) + .withCustomPersistentDisks( + Arrays + .asList( + new CustomPersistentDiskResource() + .withCustomPersistentDiskProperties( + new AzureFileVolume() + .withMountPath("/mypath1/mypath2") + .withMountOptions(Arrays.asList()) + .withShareName("myFileShare")) + .withStorageId("myASCStorageID"))) + .withEnableEndToEndTls(false)) + .withIdentity( + new ManagedIdentityProperties() + .withType(ManagedIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedManagedIdentity(), + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedManagedIdentity()))) + .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/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsValidateDomainSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsValidateDomainSamples.java new file mode 100644 index 0000000000000..b1ab798c56ab8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsValidateDomainSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** Samples for Apps ValidateDomain. */ +public final class AppsValidateDomainSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Apps_ValidateDomain.json + */ + /** + * Sample code: Apps_ValidateDomain. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void appsValidateDomain(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .apps() + .validateDomainWithResponse( + "myResourceGroup", + "myservice", + "myapp", + new CustomDomainValidatePayload().withName("mydomain.io"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5a04afe95128b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Bindings CreateOrUpdate. */ +public final class BindingsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_CreateOrUpdate.json + */ + /** + * Sample code: Bindings_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .bindings() + .define("mybinding") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new BindingResourceProperties() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1") + .withKey("fakeTokenPlaceholder") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsDeleteSamples.java new file mode 100644 index 0000000000000..ef7abc67c1f6d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Bindings Delete. */ +public final class BindingsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_Delete.json + */ + /** + * Sample code: Bindings_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .bindings() + .delete("myResourceGroup", "myservice", "myapp", "mybinding", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsGetSamples.java new file mode 100644 index 0000000000000..7b58e601488f6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsGetSamples.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.appplatform.generated.generated; + +/** Samples for Bindings Get. */ +public final class BindingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_Get.json + */ + /** + * Sample code: Bindings_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .bindings() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mybinding", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsListSamples.java new file mode 100644 index 0000000000000..b9883d3a1b3b0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsListSamples.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.appplatform.generated.generated; + +/** Samples for Bindings List. */ +public final class BindingsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_List.json + */ + /** + * Sample code: Bindings_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.bindings().list("myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsUpdateSamples.java new file mode 100644 index 0000000000000..8377586aa769e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.BindingResource; +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Bindings Update. */ +public final class BindingsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Bindings_Update.json + */ + /** + * Sample code: Bindings_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void bindingsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + BindingResource resource = + manager + .bindings() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mybinding", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new BindingResourceProperties() + .withKey("fakeTokenPlaceholder") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .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/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolGetSamples.java new file mode 100644 index 0000000000000..5b996edff9b16 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolGetSamples.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.appplatform.generated.generated; + +/** Samples for BuildServiceAgentPool Get. */ +public final class BuildServiceAgentPoolGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceAgentPool_Get.json + */ + /** + * Sample code: BuildServiceAgentPool_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceAgentPoolGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceAgentPools() + .getWithResponse("myResourceGroup", "myservice", "default", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolListSamples.java new file mode 100644 index 0000000000000..fdc04c42a985e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolListSamples.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.appplatform.generated.generated; + +/** Samples for BuildServiceAgentPool List. */ +public final class BuildServiceAgentPoolListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceAgentPool_List.json + */ + /** + * Sample code: BuildServiceAgentPool_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceAgentPoolList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceAgentPools() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolUpdatePutSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolUpdatePutSamples.java new file mode 100644 index 0000000000000..a5da720023bef --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolUpdatePutSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolSizeProperties; + +/** Samples for BuildServiceAgentPool UpdatePut. */ +public final class BuildServiceAgentPoolUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceAgentPool_UpdatePut.json + */ + /** + * Sample code: BuildServiceAgentPool_UpdatePut. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceAgentPoolUpdatePut( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceAgentPools() + .updatePut( + "myResourceGroup", + "myservice", + "default", + "default", + new BuildServiceAgentPoolResourceInner() + .withProperties( + new BuildServiceAgentPoolProperties() + .withPoolSize(new BuildServiceAgentPoolSizeProperties().withName("S3"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..24a09c15ccdc9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.BuilderProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpacksGroupProperties; +import com.azure.resourcemanager.appplatform.generated.models.StackProperties; +import java.util.Arrays; + +/** Samples for BuildServiceBuilder CreateOrUpdate. */ +public final class BuildServiceBuilderCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json + */ + /** + * Sample code: BuildServiceBuilder_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .define("mybuilder") + .withExistingBuildService("myResourceGroup", "myservice", "default") + .withProperties( + new BuilderProperties() + .withStack(new StackProperties().withId("io.buildpacks.stacks.bionic").withVersion("base")) + .withBuildpackGroups( + Arrays + .asList( + new BuildpacksGroupProperties() + .withName("mix") + .withBuildpacks( + Arrays + .asList(new BuildpackProperties().withId("tanzu-buildpacks/java-azure")))))) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderDeleteSamples.java new file mode 100644 index 0000000000000..402f2f4b3c4c4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderDeleteSamples.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.appplatform.generated.generated; + +/** Samples for BuildServiceBuilder Delete. */ +public final class BuildServiceBuilderDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_Delete.json + */ + /** + * Sample code: BuildServiceBuilder_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .delete("myResourceGroup", "myservice", "default", "mybuilder", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderGetSamples.java new file mode 100644 index 0000000000000..8bc62bcef29ee --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderGetSamples.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.appplatform.generated.generated; + +/** Samples for BuildServiceBuilder Get. */ +public final class BuildServiceBuilderGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_Get.json + */ + /** + * Sample code: BuildServiceBuilder_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .getWithResponse("myResourceGroup", "myservice", "default", "mybuilder", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderListDeploymentsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderListDeploymentsSamples.java new file mode 100644 index 0000000000000..5c319605cfc3b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderListDeploymentsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildServiceBuilder ListDeployments. */ +public final class BuildServiceBuilderListDeploymentsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_ListDeployments.json + */ + /** + * Sample code: BuildServiceBuilder_ListDeployments. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderListDeployments( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .listDeploymentsWithResponse( + "myResourceGroup", "myservice", "default", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderListSamples.java new file mode 100644 index 0000000000000..b178fbc9d6fec --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderListSamples.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.appplatform.generated.generated; + +/** Samples for BuildServiceBuilder List. */ +public final class BuildServiceBuilderListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildServiceBuilder_List.json + */ + /** + * Sample code: BuildServiceBuilder_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceBuilderList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServiceBuilders() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateBuildSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateBuildSamples.java new file mode 100644 index 0000000000000..9ebc5bfd5d378 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateBuildSamples.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.BuildProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.CertificateReference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BuildService CreateOrUpdateBuild. */ +public final class BuildServiceCreateOrUpdateBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_CreateOrUpdateBuild.json + */ + /** + * Sample code: BuildService_CreateOrUpdateBuild. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceCreateOrUpdateBuild( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .defineBuild("mybuild") + .withExistingBuildService("myResourceGroup", "myservice", "default") + .withProperties( + new BuildProperties() + .withRelativePath( + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777") + .withBuilder( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default") + .withAgentPool( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default") + .withEnv(mapOf("environmentVariable", "test")) + .withApms( + Arrays + .asList( + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"))) + .withCertificates( + Arrays + .asList( + new CertificateReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), + new CertificateReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"))) + .withResourceRequests(new BuildResourceRequests().withCpu("1").withMemory("2Gi"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ec2074b7d7e84 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceProperties; + +/** Samples for BuildService CreateOrUpdate. */ +public final class BuildServiceCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_CreateOrUpdate.json + */ + /** + * Sample code: BuildService_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new BuildServiceProperties() + .withContainerRegistry( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/containerRegistrys/default")) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceDeleteBuildSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceDeleteBuildSamples.java new file mode 100644 index 0000000000000..142604f3042fe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceDeleteBuildSamples.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.appplatform.generated.generated; + +/** Samples for BuildService DeleteBuild. */ +public final class BuildServiceDeleteBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_DeleteBuild.json + */ + /** + * Sample code: BuildService_DeleteBuild. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceDeleteBuild( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .deleteBuild("myResourceGroup", "myservice", "default", "mybuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultLogSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultLogSamples.java new file mode 100644 index 0000000000000..1e4e848297e1b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultLogSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService GetBuildResultLog. */ +public final class BuildServiceGetBuildResultLogSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuildResultLog.json + */ + /** + * Sample code: BuildService_GetBuildResultLog. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuildResultLog( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildResultLogWithResponse( + "myResourceGroup", "myservice", "default", "mybuild", "123", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultSamples.java new file mode 100644 index 0000000000000..7a19693e72d53 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService GetBuildResult. */ +public final class BuildServiceGetBuildResultSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuildResult.json + */ + /** + * Sample code: BuildService_GetBuildResult. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuildResult( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildResultWithResponse( + "myResourceGroup", "myservice", "default", "mybuild", "123", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildSamples.java new file mode 100644 index 0000000000000..35620ef69bda6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService GetBuild. */ +public final class BuildServiceGetBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuild.json + */ + /** + * Sample code: BuildService_GetBuild. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuild( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildWithResponse( + "myResourceGroup", "myservice", "default", "mybuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildServiceSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildServiceSamples.java new file mode 100644 index 0000000000000..91f48ed964487 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildServiceSamples.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.appplatform.generated.generated; + +/** Samples for BuildService GetBuildService. */ +public final class BuildServiceGetBuildServiceSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetBuildService.json + */ + /** + * Sample code: BuildService_GetBuildService. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetBuildService( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getBuildServiceWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetResourceUploadUrlSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetResourceUploadUrlSamples.java new file mode 100644 index 0000000000000..c8218494c18ef --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetResourceUploadUrlSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService GetResourceUploadUrl. */ +public final class BuildServiceGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetResourceUploadUrl.json + */ + /** + * Sample code: BuildService_GetResourceUploadUrl. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetResourceUploadUrl( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getResourceUploadUrlWithResponse( + "myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedBuildpackSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedBuildpackSamples.java new file mode 100644 index 0000000000000..8ed0b35158a3d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedBuildpackSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService GetSupportedBuildpack. */ +public final class BuildServiceGetSupportedBuildpackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetSupportedBuildpack.json + */ + /** + * Sample code: BuildService_GetSupportedBuildpack. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetSupportedBuildpack( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getSupportedBuildpackWithResponse( + "myResourceGroup", + "myservice", + "default", + "tanzu-buildpacks-java-azure", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedStackSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedStackSamples.java new file mode 100644 index 0000000000000..54fd60661fdf5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedStackSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService GetSupportedStack. */ +public final class BuildServiceGetSupportedStackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_GetSupportedStack.json + */ + /** + * Sample code: BuildService_GetSupportedStack. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceGetSupportedStack( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .getSupportedStackWithResponse( + "myResourceGroup", + "myservice", + "default", + "io.buildpacks.stacks.bionic-base", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildResultsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildResultsSamples.java new file mode 100644 index 0000000000000..ddeb5f5666875 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildResultsSamples.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.appplatform.generated.generated; + +/** Samples for BuildService ListBuildResults. */ +public final class BuildServiceListBuildResultsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListBuildResults.json + */ + /** + * Sample code: BuildService_ListBuildResults. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListBuildResults( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .listBuildResults("myResourceGroup", "myservice", "default", "mybuild", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildServicesSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildServicesSamples.java new file mode 100644 index 0000000000000..54d4c649487a9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildServicesSamples.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.appplatform.generated.generated; + +/** Samples for BuildService ListBuildServices. */ +public final class BuildServiceListBuildServicesSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListBuildServices.json + */ + /** + * Sample code: BuildService_ListBuildServices. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListBuildServices( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.buildServices().listBuildServices("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildsSamples.java new file mode 100644 index 0000000000000..2837d16889d2a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildsSamples.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.appplatform.generated.generated; + +/** Samples for BuildService ListBuilds. */ +public final class BuildServiceListBuildsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListBuilds.json + */ + /** + * Sample code: BuildService_ListBuilds. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListBuilds( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.buildServices().listBuilds("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedBuildpacksSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedBuildpacksSamples.java new file mode 100644 index 0000000000000..146e72626e179 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedBuildpacksSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService ListSupportedBuildpacks. */ +public final class BuildServiceListSupportedBuildpacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListSupportedBuildpacks.json + */ + /** + * Sample code: BuildService_ListSupportedBuildpacks. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListSupportedBuildpacks( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .listSupportedBuildpacksWithResponse( + "myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedStacksSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedStacksSamples.java new file mode 100644 index 0000000000000..be1e92bbe8575 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedStacksSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildService ListSupportedStacks. */ +public final class BuildServiceListSupportedStacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildService_ListSupportedStacks.json + */ + /** + * Sample code: BuildService_ListSupportedStacks. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildServiceListSupportedStacks( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildServices() + .listSupportedStacksWithResponse( + "myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f783bb32268e8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.BindingType; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingLaunchProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for BuildpackBinding CreateOrUpdate. */ +public final class BuildpackBindingCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_CreateOrUpdate.json + */ + /** + * Sample code: BuildpackBinding_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .define("myBuildpackBinding") + .withExistingBuilder("myResourceGroup", "myservice", "default", "default") + .withProperties( + new BuildpackBindingProperties() + .withBindingType(BindingType.APPLICATION_INSIGHTS) + .withLaunchProperties( + new BuildpackBindingLaunchProperties() + .withProperties(mapOf("abc", "def", "any-string", "any-string", "sampling-rate", "12.0")) + .withSecrets( + mapOf( + "connection-string", + "XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX")))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingDeleteSamples.java new file mode 100644 index 0000000000000..b25338d5b9882 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingDeleteSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildpackBinding Delete. */ +public final class BuildpackBindingDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_Delete.json + */ + /** + * Sample code: BuildpackBinding_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .delete( + "myResourceGroup", + "myservice", + "default", + "default", + "myBuildpackBinding", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingGetSamples.java new file mode 100644 index 0000000000000..7b986f1b07bd9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for BuildpackBinding Get. */ +public final class BuildpackBindingGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_Get.json + */ + /** + * Sample code: BuildpackBinding_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .getWithResponse( + "myResourceGroup", + "myservice", + "default", + "default", + "myBuildpackBinding", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingListForClusterSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingListForClusterSamples.java new file mode 100644 index 0000000000000..361cb4fdfaa41 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingListForClusterSamples.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.appplatform.generated.generated; + +/** Samples for BuildpackBinding ListForCluster. */ +public final class BuildpackBindingListForClusterSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_ListForCluster.json + */ + /** + * Sample code: BuildpackBinding_ListForCluster. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingListForCluster( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.buildpackBindings().listForCluster("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingListSamples.java new file mode 100644 index 0000000000000..035be12bdef82 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingListSamples.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.appplatform.generated.generated; + +/** Samples for BuildpackBinding List. */ +public final class BuildpackBindingListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/BuildpackBinding_List.json + */ + /** + * Sample code: BuildpackBinding_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void buildpackBindingGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .buildpackBindings() + .list("myResourceGroup", "myservice", "default", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..a23e1f5a6c268 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesCreateOrUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.KeyVaultCertificateAutoSync; +import com.azure.resourcemanager.appplatform.generated.models.KeyVaultCertificateProperties; + +/** Samples for Certificates CreateOrUpdate. */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_CreateOrUpdate.json + */ + /** + * Sample code: Certificates_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .certificates() + .define("mycertificate") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new KeyVaultCertificateProperties() + .withVaultUri("https://myvault.vault.azure.net") + .withKeyVaultCertName("fakeTokenPlaceholder") + .withCertVersion("08a219d06d874795a96db47e06fbb01e") + .withAutoSync(KeyVaultCertificateAutoSync.ENABLED)) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesDeleteSamples.java new file mode 100644 index 0000000000000..e5c26ad8a1de5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_Delete.json + */ + /** + * Sample code: Certificates_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .certificates() + .delete("myResourceGroup", "myservice", "mycertificate", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesGetSamples.java new file mode 100644 index 0000000000000..38208ac1ec11c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesGetSamples.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.appplatform.generated.generated; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_Get.json + */ + /** + * Sample code: Certificates_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .certificates() + .getWithResponse("myResourceGroup", "myservice", "mycertificate", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesListSamples.java new file mode 100644 index 0000000000000..634e0d88fc323 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesListSamples.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.appplatform.generated.generated; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Certificates_List.json + */ + /** + * Sample code: Certificates_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void certificatesList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.certificates().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersGetSamples.java new file mode 100644 index 0000000000000..ecbc92576d504 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersGetSamples.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.appplatform.generated.generated; + +/** Samples for ConfigServers Get. */ +public final class ConfigServersGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_Get.json + */ + /** + * Sample code: ConfigServers_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.configServers().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_Get_Consumption.json + */ + /** + * Sample code: ConfigServers_Get_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersGetConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.configServers().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePatchSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePatchSamples.java new file mode 100644 index 0000000000000..040a0465ddde2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePatchSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import java.util.Arrays; + +/** Samples for ConfigServers UpdatePatch. */ +public final class ConfigServersUpdatePatchSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePatch.json + */ + /** + * Sample code: ConfigServers_UpdatePatch. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePatch( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePatch( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePatch_Consumption.json + */ + /** + * Sample code: ConfigServers_UpdatePatch_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePatchConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePatch( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withEnabledState(ConfigServerEnabledState.ENABLED) + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePutSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePutSamples.java new file mode 100644 index 0000000000000..a9a1c05d10aab --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePutSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import java.util.Arrays; + +/** Samples for ConfigServers UpdatePut. */ +public final class ConfigServersUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePut_Consumption.json + */ + /** + * Sample code: ConfigServers_UpdatePut_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePutConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePut( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withEnabledState(ConfigServerEnabledState.ENABLED) + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_UpdatePut.json + */ + /** + * Sample code: ConfigServers_UpdatePut. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersUpdatePut( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .updatePut( + "myResourceGroup", + "myservice", + new ConfigServerResourceInner() + .withProperties( + new ConfigServerProperties() + .withConfigServer( + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersValidateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersValidateSamples.java new file mode 100644 index 0000000000000..2887f14027da6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersValidateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettings; +import java.util.Arrays; + +/** Samples for ConfigServers Validate. */ +public final class ConfigServersValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigServers_Validate.json + */ + /** + * Sample code: ConfigServers_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configServersValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configServers() + .validate( + "myResourceGroup", + "myservice", + new ConfigServerSettings() + .withGitProperty( + new ConfigServerGitProperty() + .withUri("https://github.com/fake-user/fake-repository.git") + .withLabel("master") + .withSearchPaths(Arrays.asList("/"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..66af50c382a4d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import java.util.Arrays; + +/** Samples for ConfigurationServices CreateOrUpdate. */ +public final class ConfigurationServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_CreateOrUpdate.json + */ + /** + * Sample code: ConfigurationServices_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new ConfigurationServiceProperties() + .withSettings( + new ConfigurationServiceSettings() + .withGitProperty( + new ConfigurationServiceGitProperty() + .withRepositories( + Arrays + .asList( + new ConfigurationServiceGitRepository() + .withName("fake") + .withPatterns(Arrays.asList("app/dev")) + .withUri("https://github.com/fake-user/fake-repository") + .withLabel("master")))))) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesDeleteSamples.java new file mode 100644 index 0000000000000..31899de5f061d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ConfigurationServices Delete. */ +public final class ConfigurationServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_Delete.json + */ + /** + * Sample code: ConfigurationServices_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesGetSamples.java new file mode 100644 index 0000000000000..1e4cb1600c63c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesGetSamples.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.appplatform.generated.generated; + +/** Samples for ConfigurationServices Get. */ +public final class ConfigurationServicesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_Get.json + */ + /** + * Sample code: ConfigurationServices_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesListSamples.java new file mode 100644 index 0000000000000..ee13ea1655e34 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesListSamples.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.appplatform.generated.generated; + +/** Samples for ConfigurationServices List. */ +public final class ConfigurationServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_List.json + */ + /** + * Sample code: ConfigurationServices_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.configurationServices().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateResourceSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateResourceSamples.java new file mode 100644 index 0000000000000..341532b42a53a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateResourceSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import java.util.Arrays; + +/** Samples for ConfigurationServices ValidateResource. */ +public final class ConfigurationServicesValidateResourceSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_ValidateResource.json + */ + /** + * Sample code: ConfigurationServices_ValidateResource. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesValidateResource( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .validateResource( + "myResourceGroup", + "myservice", + "default", + new ConfigurationServiceResourceInner() + .withProperties( + new ConfigurationServiceProperties() + .withSettings( + new ConfigurationServiceSettings() + .withGitProperty( + new ConfigurationServiceGitProperty() + .withRepositories( + Arrays + .asList( + new ConfigurationServiceGitRepository() + .withName("fake") + .withPatterns(Arrays.asList("app/dev")) + .withUri("https://github.com/fake-user/fake-repository") + .withLabel("master")))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateSamples.java new file mode 100644 index 0000000000000..dd3ccc98ff69d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitProperty; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceSettings; +import java.util.Arrays; + +/** Samples for ConfigurationServices Validate. */ +public final class ConfigurationServicesValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ConfigurationServices_Validate.json + */ + /** + * Sample code: ConfigurationServices_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void configurationServicesValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .configurationServices() + .validate( + "myResourceGroup", + "myservice", + "default", + new ConfigurationServiceSettings() + .withGitProperty( + new ConfigurationServiceGitProperty() + .withRepositories( + Arrays + .asList( + new ConfigurationServiceGitRepository() + .withName("fake") + .withPatterns(Arrays.asList("app/dev")) + .withUri("https://github.com/fake-user/fake-repository") + .withLabel("master")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..47a7b70df07fa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryBasicCredentials; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; + +/** Samples for ContainerRegistries CreateOrUpdate. */ +public final class ContainerRegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_CreateOrUpdate.json + */ + /** + * Sample code: ContainerRegistries_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .define("my-container-registry") + .withExistingSpring("myResourceGroup", "my-service") + .withProperties( + new ContainerRegistryProperties() + .withCredentials( + new ContainerRegistryBasicCredentials() + .withServer("myServer") + .withUsername("myUsername") + .withPassword("fakeTokenPlaceholder"))) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesDeleteSamples.java new file mode 100644 index 0000000000000..db6368aba6c4a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ContainerRegistries Delete. */ +public final class ContainerRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_Delete.json + */ + /** + * Sample code: ContainerRegistries_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .delete("myResourceGroup", "service-name", "my-container-registry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesGetSamples.java new file mode 100644 index 0000000000000..dadbb46e9e962 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for ContainerRegistries Get. */ +public final class ContainerRegistriesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_Get.json + */ + /** + * Sample code: ContainerRegistries_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .getWithResponse( + "myResourceGroup", "service-name", "my-container-registry", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesListSamples.java new file mode 100644 index 0000000000000..657b6420aea8e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesListSamples.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.appplatform.generated.generated; + +/** Samples for ContainerRegistries List. */ +public final class ContainerRegistriesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_List.json + */ + /** + * Sample code: ContainerRegistries_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.containerRegistries().list("myResourceGroup", "my-service", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesValidateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesValidateSamples.java new file mode 100644 index 0000000000000..85c5f267830ac --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ContainerRegistriesValidateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryBasicCredentials; +import com.azure.resourcemanager.appplatform.generated.models.ContainerRegistryProperties; + +/** Samples for ContainerRegistries Validate. */ +public final class ContainerRegistriesValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ContainerRegistries_Validate.json + */ + /** + * Sample code: ContainerRegistries_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void containerRegistriesValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .containerRegistries() + .validate( + "myResourceGroup", + "my-service", + "my-container-registry", + new ContainerRegistryProperties() + .withCredentials( + new ContainerRegistryBasicCredentials() + .withServer("myServer") + .withUsername("myUsername") + .withPassword("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ce498911a8dee --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; + +/** Samples for CustomDomains CreateOrUpdate. */ +public final class CustomDomainsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_CreateOrUpdate.json + */ + /** + * Sample code: CustomDomains_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customDomains() + .define("mydomain.com") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new CustomDomainProperties() + .withThumbprint("934367bf1c97033f877db0f15cb1b586957d3133") + .withCertName("mycert")) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsDeleteSamples.java new file mode 100644 index 0000000000000..accccdb3f4df1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for CustomDomains Delete. */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_Delete.json + */ + /** + * Sample code: CustomDomains_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customDomains() + .delete("myResourceGroup", "myservice", "myapp", "mydomain.com", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsGetSamples.java new file mode 100644 index 0000000000000..88b28af9ef5fd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsGetSamples.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.appplatform.generated.generated; + +/** Samples for CustomDomains Get. */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_Get.json + */ + /** + * Sample code: CustomDomains_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customDomains() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mydomain.com", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsListSamples.java new file mode 100644 index 0000000000000..193dd51a114b2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsListSamples.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.appplatform.generated.generated; + +/** Samples for CustomDomains List. */ +public final class CustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_List.json + */ + /** + * Sample code: CustomDomains_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.customDomains().list("myResourceGroup", "myservice", "myapp", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsUpdateSamples.java new file mode 100644 index 0000000000000..2676629bd6148 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainResource; + +/** Samples for CustomDomains Update. */ +public final class CustomDomainsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomDomains_Update.json + */ + /** + * Sample code: CustomDomains_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customDomainsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + CustomDomainResource resource = + manager + .customDomains() + .getWithResponse( + "myResourceGroup", "myservice", "myapp", "mydomain.com", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new CustomDomainProperties() + .withThumbprint("934367bf1c97033f877db0f15cb1b586957d3133") + .withCertName("mycert")) + .apply(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..451708df5f21d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorSshSetting; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.Arrays; + +/** Samples for CustomizedAccelerators CreateOrUpdate. */ +public final class CustomizedAcceleratorsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_CreateOrUpdate.json + */ + /** + * Sample code: CustomizedAccelerators_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .define("acc-name") + .withExistingApplicationAccelerator("myResourceGroup", "myservice", "default") + .withProperties( + new CustomizedAcceleratorProperties() + .withDisplayName("acc-name") + .withDescription("acc-desc") + .withIconUrl("acc-icon") + .withAcceleratorTags(Arrays.asList("tag-a", "tag-b")) + .withGitRepository( + new AcceleratorGitRepository() + .withUrl("git-url") + .withIntervalInSeconds(70) + .withBranch("git-branch") + .withCommit("12345") + .withGitTag("git-tag") + .withAuthSetting( + new AcceleratorSshSetting() + .withHostKey("fakeTokenPlaceholder") + .withHostKeyAlgorithm("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsDeleteSamples.java new file mode 100644 index 0000000000000..feb9614a8a61c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for CustomizedAccelerators Delete. */ +public final class CustomizedAcceleratorsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_Delete.json + */ + /** + * Sample code: CustomizedAccelerators_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .delete("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsGetSamples.java new file mode 100644 index 0000000000000..af5791b28efd4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsGetSamples.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.appplatform.generated.generated; + +/** Samples for CustomizedAccelerators Get. */ +public final class CustomizedAcceleratorsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_Get.json + */ + /** + * Sample code: CustomizedAccelerators_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .getWithResponse("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsListSamples.java new file mode 100644 index 0000000000000..3aa9d7d7170da --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsListSamples.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.appplatform.generated.generated; + +/** Samples for CustomizedAccelerators List. */ +public final class CustomizedAcceleratorsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_List.json + */ + /** + * Sample code: CustomizedAccelerators_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsValidateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsValidateSamples.java new file mode 100644 index 0000000000000..df9773c053329 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomizedAcceleratorsValidateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorGitRepository; +import com.azure.resourcemanager.appplatform.generated.models.AcceleratorSshSetting; +import com.azure.resourcemanager.appplatform.generated.models.CustomizedAcceleratorProperties; +import java.util.Arrays; + +/** Samples for CustomizedAccelerators Validate. */ +public final class CustomizedAcceleratorsValidateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/CustomizedAccelerators_Validate.json + */ + /** + * Sample code: CustomizedAccelerators_Validate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void customizedAcceleratorsValidate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .customizedAccelerators() + .validateWithResponse( + "myResourceGroup", + "myservice", + "default", + "acc-name", + new CustomizedAcceleratorProperties() + .withDisplayName("acc-name") + .withDescription("acc-desc") + .withIconUrl("acc-icon") + .withAcceleratorTags(Arrays.asList("tag-a", "tag-b")) + .withGitRepository( + new AcceleratorGitRepository() + .withUrl("git-url") + .withIntervalInSeconds(70) + .withBranch("git-branch") + .withCommit("12345") + .withGitTag("git-tag") + .withAuthSetting( + new AcceleratorSshSetting() + .withHostKey("fakeTokenPlaceholder") + .withHostKeyAlgorithm("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ab1fcbafda534 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsCreateOrUpdateSamples.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.CustomContainer; +import com.azure.resourcemanager.appplatform.generated.models.CustomContainerUserSourceInfo; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentSettings; +import com.azure.resourcemanager.appplatform.generated.models.HttpGetAction; +import com.azure.resourcemanager.appplatform.generated.models.HttpSchemeType; +import com.azure.resourcemanager.appplatform.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.appplatform.generated.models.Probe; +import com.azure.resourcemanager.appplatform.generated.models.ResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.azure.resourcemanager.appplatform.generated.models.SourceUploadedUserSourceInfo; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Deployments CreateOrUpdate. */ +public final class DeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_CreateOrUpdate.json + */ + /** + * Sample code: Deployments_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) throws IOException { + manager + .deployments() + .define("mydeployment") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new DeploymentResourceProperties() + .withSource( + new SourceUploadedUserSourceInfo() + .withVersion("1.0") + .withRelativePath( + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc") + .withArtifactSelector("sub-module-1")) + .withDeploymentSettings( + new DeploymentSettings() + .withResourceRequests(new ResourceRequests().withCpu("1000m").withMemory("3Gi")) + .withEnvironmentVariables(mapOf("env", "test")) + .withApms( + Arrays + .asList( + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"))) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "patterns", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("[\"mypattern\"]", Object.class, SerializerEncoding.JSON)))) + .withLivenessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withReadinessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withTerminationGracePeriodSeconds(30))) + .withSku(new Sku().withName("S0").withTier("Standard").withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json + */ + /** + * Sample code: Deployments_CreateOrUpdate_CustomContainer. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsCreateOrUpdateCustomContainer( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .define("mydeployment") + .withExistingApp("myResourceGroup", "myservice", "myapp") + .withProperties( + new DeploymentResourceProperties() + .withSource( + new CustomContainerUserSourceInfo() + .withCustomContainer( + new CustomContainer() + .withServer("myacr.azurecr.io") + .withContainerImage("myContainerImage:v1") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withImageRegistryCredential( + new ImageRegistryCredential() + .withUsername("myUsername") + .withPassword("fakeTokenPlaceholder")) + .withLanguageFramework("springboot"))) + .withDeploymentSettings( + new DeploymentSettings() + .withResourceRequests(new ResourceRequests().withCpu("1000m").withMemory("3Gi")) + .withEnvironmentVariables(mapOf("env", "test")) + .withLivenessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withReadinessProbe( + new Probe() + .withProbeAction( + new HttpGetAction().withPath("/health").withScheme(HttpSchemeType.HTTP)) + .withDisableProbe(false) + .withInitialDelaySeconds(30) + .withPeriodSeconds(10) + .withFailureThreshold(3)) + .withTerminationGracePeriodSeconds(30))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsDeleteSamples.java new file mode 100644 index 0000000000000..e1bbc0b5094cc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Deployments Delete. */ +public final class DeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Delete.json + */ + /** + * Sample code: Deployments_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .delete("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsDisableRemoteDebuggingSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsDisableRemoteDebuggingSamples.java new file mode 100644 index 0000000000000..d110b9cf874aa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsDisableRemoteDebuggingSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for Deployments DisableRemoteDebugging. */ +public final class DeploymentsDisableRemoteDebuggingSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_DisableRemoteDebugging.json + */ + /** + * Sample code: Deployments_DisableRemoteDebugging. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsDisableRemoteDebugging( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .disableRemoteDebugging( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsEnableRemoteDebuggingSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsEnableRemoteDebuggingSamples.java new file mode 100644 index 0000000000000..af2e40c063334 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsEnableRemoteDebuggingSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.RemoteDebuggingPayload; + +/** Samples for Deployments EnableRemoteDebugging. */ +public final class DeploymentsEnableRemoteDebuggingSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_EnableRemoteDebugging.json + */ + /** + * Sample code: Deployments_EnableRemoteDebugging. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsEnableRemoteDebugging( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .enableRemoteDebugging( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new RemoteDebuggingPayload(), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateHeapDumpSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateHeapDumpSamples.java new file mode 100644 index 0000000000000..460530d3d6aad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateHeapDumpSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; + +/** Samples for Deployments GenerateHeapDump. */ +public final class DeploymentsGenerateHeapDumpSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GenerateHeapDump.json + */ + /** + * Sample code: Deployments_GenerateHeapDump. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGenerateHeapDump( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .generateHeapDump( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new DiagnosticParameters().withAppInstance("myappinstance").withFilePath("/byos/diagnose"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateThreadDumpSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateThreadDumpSamples.java new file mode 100644 index 0000000000000..70871adb6be41 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateThreadDumpSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; + +/** Samples for Deployments GenerateThreadDump. */ +public final class DeploymentsGenerateThreadDumpSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GenerateThreadDump.json + */ + /** + * Sample code: Deployments_GenerateHeapDump. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGenerateHeapDump( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .generateThreadDump( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new DiagnosticParameters().withAppInstance("myappinstance").withFilePath("/byos/diagnose"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetLogFileUrlSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetLogFileUrlSamples.java new file mode 100644 index 0000000000000..08b70d0c9b1d7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetLogFileUrlSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for Deployments GetLogFileUrl. */ +public final class DeploymentsGetLogFileUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GetLogFileUrl.json + */ + /** + * Sample code: Deployments_GetLogFileUrl. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGetLogFileUrl( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getLogFileUrlWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetRemoteDebuggingConfigSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetRemoteDebuggingConfigSamples.java new file mode 100644 index 0000000000000..7a9fe44d3ae19 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetRemoteDebuggingConfigSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for Deployments GetRemoteDebuggingConfig. */ +public final class DeploymentsGetRemoteDebuggingConfigSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_GetRemoteDebuggingConfig.json + */ + /** + * Sample code: Deployments_GetRemoteDebuggingConfig. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGetRemoteDebuggingConfig( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getRemoteDebuggingConfigWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetSamples.java new file mode 100644 index 0000000000000..e747af738c6b8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for Deployments Get. */ +public final class DeploymentsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Get.json + */ + /** + * Sample code: Deployments_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Get_CustomContainer.json + */ + /** + * Sample code: Deployments_Get_CustomContainer. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsGetCustomContainer( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .getWithResponse("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsListForClusterSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsListForClusterSamples.java new file mode 100644 index 0000000000000..342a921acd251 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsListForClusterSamples.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.appplatform.generated.generated; + +/** Samples for Deployments ListForCluster. */ +public final class DeploymentsListForClusterSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_ListForCluster.json + */ + /** + * Sample code: Deployments_ListForCluster. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsListForCluster( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .listForCluster("myResourceGroup", "myservice", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsListSamples.java new file mode 100644 index 0000000000000..41bc60fadd327 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsListSamples.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.appplatform.generated.generated; + +/** Samples for Deployments List. */ +public final class DeploymentsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_List.json + */ + /** + * Sample code: Deployments_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .list("myResourceGroup", "myservice", "myapp", null, null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsRestartSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsRestartSamples.java new file mode 100644 index 0000000000000..916e8adeb2816 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsRestartSamples.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.appplatform.generated.generated; + +/** Samples for Deployments Restart. */ +public final class DeploymentsRestartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Restart.json + */ + /** + * Sample code: Deployments_Restart. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsRestart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .restart("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartJfrSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartJfrSamples.java new file mode 100644 index 0000000000000..8e91f59148f63 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartJfrSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; + +/** Samples for Deployments StartJfr. */ +public final class DeploymentsStartJfrSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_StartJFR.json + */ + /** + * Sample code: Deployments_StartJFR. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsStartJFR(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .startJfr( + "myResourceGroup", + "myservice", + "myapp", + "mydeployment", + new DiagnosticParameters() + .withAppInstance("myappinstance") + .withFilePath("/byos/diagnose") + .withDuration("60s"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartSamples.java new file mode 100644 index 0000000000000..b35d0ee97d833 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartSamples.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.appplatform.generated.generated; + +/** Samples for Deployments Start. */ +public final class DeploymentsStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Start.json + */ + /** + * Sample code: Deployments_Start. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsStart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .start("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStopSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStopSamples.java new file mode 100644 index 0000000000000..fccf730847507 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStopSamples.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.appplatform.generated.generated; + +/** Samples for Deployments Stop. */ +public final class DeploymentsStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Stop.json + */ + /** + * Sample code: Deployments_Stop. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsStop(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .deployments() + .stop("myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsUpdateSamples.java new file mode 100644 index 0000000000000..36acfb4daa247 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsUpdateSamples.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.CustomContainer; +import com.azure.resourcemanager.appplatform.generated.models.CustomContainerUserSourceInfo; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResource; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ImageRegistryCredential; +import com.azure.resourcemanager.appplatform.generated.models.SourceUploadedUserSourceInfo; +import java.util.Arrays; + +/** Samples for Deployments Update. */ +public final class DeploymentsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Update.json + */ + /** + * Sample code: Deployments_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + DeploymentResource resource = + manager + .deployments() + .getWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new DeploymentResourceProperties() + .withSource( + new SourceUploadedUserSourceInfo() + .withVersion("1.0") + .withRelativePath( + "resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc") + .withArtifactSelector("sub-module-1"))) + .apply(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Deployments_Update_CustomContainer.json + */ + /** + * Sample code: Deployments_Update_CustomContainer. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void deploymentsUpdateCustomContainer( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + DeploymentResource resource = + manager + .deployments() + .getWithResponse( + "myResourceGroup", "myservice", "myapp", "mydeployment", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new DeploymentResourceProperties() + .withSource( + new CustomContainerUserSourceInfo() + .withCustomContainer( + new CustomContainer() + .withServer("mynewacr.azurecr.io") + .withContainerImage("myNewContainerImage:v1") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withImageRegistryCredential( + new ImageRegistryCredential() + .withUsername("myNewUsername") + .withPassword("fakeTokenPlaceholder"))))) + .apply(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c91d597e0b5d9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalFeatureDetail; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalFeatureSettings; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalFeatureState; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.DevToolPortalSsoProperties; +import java.util.Arrays; + +/** Samples for DevToolPortals CreateOrUpdate. */ +public final class DevToolPortalsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortals_CreateOrUpdate.json + */ + /** + * Sample code: DevToolPortals_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .devToolPortals() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new DevToolPortalProperties() + .withPublicProperty(true) + .withSsoProperties( + new DevToolPortalSsoProperties() + .withScopes(Arrays.asList("openid")) + .withClientId("00000000-0000-0000-0000-000000000000") + .withClientSecret("fakeTokenPlaceholder") + .withMetadataUrl( + "https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration")) + .withFeatures( + new DevToolPortalFeatureSettings() + .withApplicationAccelerator( + new DevToolPortalFeatureDetail().withState(DevToolPortalFeatureState.ENABLED)) + .withApplicationLiveView( + new DevToolPortalFeatureDetail().withState(DevToolPortalFeatureState.ENABLED)))) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsDeleteSamples.java new file mode 100644 index 0000000000000..6dca28543cf1a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for DevToolPortals Delete. */ +public final class DevToolPortalsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortal_Delete.json + */ + /** + * Sample code: DevToolPortals_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.devToolPortals().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsGetSamples.java new file mode 100644 index 0000000000000..f794b1687be41 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsGetSamples.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.appplatform.generated.generated; + +/** Samples for DevToolPortals Get. */ +public final class DevToolPortalsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortals_Get.json + */ + /** + * Sample code: DevToolPortals_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .devToolPortals() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsListSamples.java new file mode 100644 index 0000000000000..cabdee1b7c109 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DevToolPortalsListSamples.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.appplatform.generated.generated; + +/** Samples for DevToolPortals List. */ +public final class DevToolPortalsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/DevToolPortals_List.json + */ + /** + * Sample code: DevToolPortals_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void devToolPortalsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.devToolPortals().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersGetSamples.java new file mode 100644 index 0000000000000..0d20b75730f95 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersGetSamples.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.appplatform.generated.generated; + +/** Samples for EurekaServers Get. */ +public final class EurekaServersGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_Get_Consumption.json + */ + /** + * Sample code: EurekaServers_Get_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersGetConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.eurekaServers().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersListSamples.java new file mode 100644 index 0000000000000..97b30be99841f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersListSamples.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.appplatform.generated.generated; + +/** Samples for EurekaServers List. */ +public final class EurekaServersListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_List_Consumption.json + */ + /** + * Sample code: EurekaServers_List_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersListConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.eurekaServers().listWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersUpdatePatchSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersUpdatePatchSamples.java new file mode 100644 index 0000000000000..ed19898ec4551 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersUpdatePatchSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerProperties; + +/** Samples for EurekaServers UpdatePatch. */ +public final class EurekaServersUpdatePatchSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_UpdatePatch_Consumption.json + */ + /** + * Sample code: EurekaServers_UpdatePatch. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersUpdatePatch( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .eurekaServers() + .updatePatch( + "myResourceGroup", + "myservice", + new EurekaServerResourceInner() + .withProperties(new EurekaServerProperties().withEnabledState(EurekaServerEnabledState.ENABLED)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersUpdatePutSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersUpdatePutSamples.java new file mode 100644 index 0000000000000..ebef2f9c52acc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/EurekaServersUpdatePutSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.EurekaServerResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerEnabledState; +import com.azure.resourcemanager.appplatform.generated.models.EurekaServerProperties; + +/** Samples for EurekaServers UpdatePut. */ +public final class EurekaServersUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/EurekaServers_UpdatePut_Consumption.json + */ + /** + * Sample code: EurekaServers_UpdatePut_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void eurekaServersUpdatePutConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .eurekaServers() + .updatePut( + "myResourceGroup", + "myservice", + new EurekaServerResourceInner() + .withProperties(new EurekaServerProperties().withEnabledState(EurekaServerEnabledState.ENABLED)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..7847eb459dde3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainProperties; + +/** Samples for GatewayCustomDomains CreateOrUpdate. */ +public final class GatewayCustomDomainsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json + */ + /** + * Sample code: GatewayCustomDomains_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .define("myDomainName") + .withExistingGateway("myResourceGroup", "myservice", "default") + .withProperties(new GatewayCustomDomainProperties().withThumbprint("*")) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsDeleteSamples.java new file mode 100644 index 0000000000000..0d86a32e5fa43 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for GatewayCustomDomains Delete. */ +public final class GatewayCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_Delete.json + */ + /** + * Sample code: GatewayCustomDomains_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .delete("myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsGetSamples.java new file mode 100644 index 0000000000000..c168104f7d24e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for GatewayCustomDomains Get. */ +public final class GatewayCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_Get.json + */ + /** + * Sample code: GatewayCustomDomains_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .getWithResponse( + "myResourceGroup", "myservice", "default", "myDomainName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsListSamples.java new file mode 100644 index 0000000000000..dd6893c336d1f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsListSamples.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.appplatform.generated.generated; + +/** Samples for GatewayCustomDomains List. */ +public final class GatewayCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayCustomDomains_List.json + */ + /** + * Sample code: GatewayCustomDomains_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayCustomDomainsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayCustomDomains() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..5c12462a1411e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.GatewayApiRoute; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigOpenApiProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProtocol; +import java.util.Arrays; + +/** Samples for GatewayRouteConfigs CreateOrUpdate. */ +public final class GatewayRouteConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json + */ + /** + * Sample code: GatewayRouteConfigs_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayRouteConfigs() + .define("myRouteConfig") + .withExistingGateway("myResourceGroup", "myservice", "default") + .withProperties( + new GatewayRouteConfigProperties() + .withAppResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp") + .withOpenApi( + new GatewayRouteConfigOpenApiProperties() + .withUri( + "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json")) + .withProtocol(GatewayRouteConfigProtocol.HTTPS) + .withRoutes( + Arrays + .asList( + new GatewayApiRoute() + .withTitle("myApp route config") + .withSsoEnabled(true) + .withPredicates(Arrays.asList("Path=/api5/customer/**")) + .withFilters(Arrays.asList("StripPrefix=2", "RateLimit=1,1s"))))) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsDeleteSamples.java new file mode 100644 index 0000000000000..c077aafae93ce --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsDeleteSamples.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.appplatform.generated.generated; + +/** Samples for GatewayRouteConfigs Delete. */ +public final class GatewayRouteConfigsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_Delete.json + */ + /** + * Sample code: GatewayRouteConfigs_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayRouteConfigs() + .delete("myResourceGroup", "myservice", "default", "myRouteConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsGetSamples.java new file mode 100644 index 0000000000000..24fd7dfcf21cb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for GatewayRouteConfigs Get. */ +public final class GatewayRouteConfigsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_Get.json + */ + /** + * Sample code: GatewayRouteConfigs_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gatewayRouteConfigs() + .getWithResponse( + "myResourceGroup", "myservice", "default", "myRouteConfig", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsListSamples.java new file mode 100644 index 0000000000000..7d1bb2ddc55ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsListSamples.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.appplatform.generated.generated; + +/** Samples for GatewayRouteConfigs List. */ +public final class GatewayRouteConfigsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/GatewayRouteConfigs_List.json + */ + /** + * Sample code: GatewayRouteConfigs_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayRouteConfigsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gatewayRouteConfigs().list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d5f12b9752255 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysCreateOrUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; +import com.azure.resourcemanager.appplatform.generated.models.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.Arrays; + +/** Samples for Gateways CreateOrUpdate. */ +public final class GatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_CreateOrUpdate.json + */ + /** + * Sample code: Gateways_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gateways() + .define("default") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new GatewayProperties() + .withPublicProperty(true) + .withApms( + Arrays + .asList( + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"))) + .withResourceRequests(new GatewayResourceRequests().withCpu("1").withMemory("1G"))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysDeleteSamples.java new file mode 100644 index 0000000000000..207b3088b3d81 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Gateways Delete. */ +public final class GatewaysDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_Delete.json + */ + /** + * Sample code: Gateways_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysGetSamples.java new file mode 100644 index 0000000000000..8efe5f1b50b50 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysGetSamples.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.appplatform.generated.generated; + +/** Samples for Gateways Get. */ +public final class GatewaysGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_Get.json + */ + /** + * Sample code: Gateways_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListEnvSecretsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListEnvSecretsSamples.java new file mode 100644 index 0000000000000..88e1485200a12 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListEnvSecretsSamples.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.appplatform.generated.generated; + +/** Samples for Gateways ListEnvSecrets. */ +public final class GatewaysListEnvSecretsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_ListEnvSecrets.json + */ + /** + * Sample code: Gateways_ListEnvSecrets. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysListEnvSecrets( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gateways() + .listEnvSecretsWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListSamples.java new file mode 100644 index 0000000000000..df83db7f572ca --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListSamples.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.appplatform.generated.generated; + +/** Samples for Gateways List. */ +public final class GatewaysListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_List.json + */ + /** + * Sample code: Gateways_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysRestartSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysRestartSamples.java new file mode 100644 index 0000000000000..ef331cce5f467 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysRestartSamples.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.appplatform.generated.generated; + +/** Samples for Gateways Restart. */ +public final class GatewaysRestartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_Restart.json + */ + /** + * Sample code: Gateways_Restart. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysRestart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.gateways().restart("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysUpdateCapacitySamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysUpdateCapacitySamples.java new file mode 100644 index 0000000000000..8c2f191485eff --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysUpdateCapacitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.GatewayResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +/** Samples for Gateways UpdateCapacity. */ +public final class GatewaysUpdateCapacitySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateway_Scale.json + */ + /** + * Sample code: Gateway_Scale. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewayScale(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + GatewayResource resource = + manager + .gateways() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)).apply(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysValidateDomainSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysValidateDomainSamples.java new file mode 100644 index 0000000000000..1964bc4b77197 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysValidateDomainSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainValidatePayload; + +/** Samples for Gateways ValidateDomain. */ +public final class GatewaysValidateDomainSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Gateways_ValidateDomain.json + */ + /** + * Sample code: Gateways_ValidateDomain. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void gatewaysValidateDomain( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .gateways() + .validateDomainWithResponse( + "myResourceGroup", + "myservice", + "default", + new CustomDomainValidatePayload().withName("mydomain.io"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsGetSamples.java new file mode 100644 index 0000000000000..46d79589ce5fc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsGetSamples.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.appplatform.generated.generated; + +/** Samples for MonitoringSettings Get. */ +public final class MonitoringSettingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/MonitoringSettings_Get.json + */ + /** + * Sample code: MonitoringSettings_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void monitoringSettingsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.monitoringSettings().getWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePatchSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePatchSamples.java new file mode 100644 index 0000000000000..3cc157724c872 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePatchSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; + +/** Samples for MonitoringSettings UpdatePatch. */ +public final class MonitoringSettingsUpdatePatchSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/MonitoringSettings_UpdatePatch.json + */ + /** + * Sample code: MonitoringSettings_UpdatePatch. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void monitoringSettingsUpdatePatch( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .monitoringSettings() + .updatePatch( + "myResourceGroup", + "myservice", + new MonitoringSettingResourceInner() + .withProperties( + new MonitoringSettingProperties() + .withTraceEnabled(true) + .withAppInsightsInstrumentationKey("fakeTokenPlaceholder") + .withAppInsightsSamplingRate(10.0D)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePutSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePutSamples.java new file mode 100644 index 0000000000000..80ff088d5e6c9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePutSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.fluent.models.MonitoringSettingResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; + +/** Samples for MonitoringSettings UpdatePut. */ +public final class MonitoringSettingsUpdatePutSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/MonitoringSettings_UpdatePut.json + */ + /** + * Sample code: MonitoringSettings_UpdatePut. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void monitoringSettingsUpdatePut( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .monitoringSettings() + .updatePut( + "myResourceGroup", + "myservice", + new MonitoringSettingResourceInner() + .withProperties( + new MonitoringSettingProperties() + .withTraceEnabled(true) + .withAppInsightsInstrumentationKey("fakeTokenPlaceholder") + .withAppInsightsSamplingRate(10.0D)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/OperationsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..8768d3f048c30 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/OperationsListSamples.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.appplatform.generated.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void operationsList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsDisableSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsDisableSamples.java new file mode 100644 index 0000000000000..4a6b025c256e2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsDisableSamples.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.appplatform.generated.generated; + +/** Samples for PredefinedAccelerators Disable. */ +public final class PredefinedAcceleratorsDisableSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_Disable.json + */ + /** + * Sample code: PredefinedAccelerators_Disable. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsDisable( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .disable("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsEnableSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsEnableSamples.java new file mode 100644 index 0000000000000..3fbffd927f7ee --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsEnableSamples.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.appplatform.generated.generated; + +/** Samples for PredefinedAccelerators Enable. */ +public final class PredefinedAcceleratorsEnableSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_Enable.json + */ + /** + * Sample code: PredefinedAccelerators_Enable. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsEnable( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .enable("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsGetSamples.java new file mode 100644 index 0000000000000..dc4769e091bc6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsGetSamples.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.appplatform.generated.generated; + +/** Samples for PredefinedAccelerators Get. */ +public final class PredefinedAcceleratorsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_Get.json + */ + /** + * Sample code: PredefinedAccelerators_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .getWithResponse("myResourceGroup", "myservice", "default", "acc-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsListSamples.java new file mode 100644 index 0000000000000..bd39b28d8542f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/PredefinedAcceleratorsListSamples.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.appplatform.generated.generated; + +/** Samples for PredefinedAccelerators List. */ +public final class PredefinedAcceleratorsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/PredefinedAccelerators_List.json + */ + /** + * Sample code: PredefinedAccelerators_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void predefinedAcceleratorsList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .predefinedAccelerators() + .list("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/RuntimeVersionsListRuntimeVersionsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/RuntimeVersionsListRuntimeVersionsSamples.java new file mode 100644 index 0000000000000..b876a12e7167e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/RuntimeVersionsListRuntimeVersionsSamples.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.appplatform.generated.generated; + +/** Samples for RuntimeVersions ListRuntimeVersions. */ +public final class RuntimeVersionsListRuntimeVersionsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json + */ + /** + * Sample code: RuntimeVersions_ListRuntimeVersions. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void runtimeVersionsListRuntimeVersions( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.runtimeVersions().listRuntimeVersionsWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..c4de84496e5fb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesCreateOrUpdateSamples.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.appplatform.generated.generated; + +/** Samples for ServiceRegistries CreateOrUpdate. */ +public final class ServiceRegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_CreateOrUpdate.json + */ + /** + * Sample code: ServiceRegistries_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .serviceRegistries() + .createOrUpdate("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesDeleteSamples.java new file mode 100644 index 0000000000000..9b04475d91e6f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesDeleteSamples.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.appplatform.generated.generated; + +/** Samples for ServiceRegistries Delete. */ +public final class ServiceRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_Delete.json + */ + /** + * Sample code: ServiceRegistries_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesDelete( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.serviceRegistries().delete("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesGetSamples.java new file mode 100644 index 0000000000000..f42f517fc98e9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesGetSamples.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.appplatform.generated.generated; + +/** Samples for ServiceRegistries Get. */ +public final class ServiceRegistriesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_Get.json + */ + /** + * Sample code: ServiceRegistries_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesGet( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .serviceRegistries() + .getWithResponse("myResourceGroup", "myservice", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesListSamples.java new file mode 100644 index 0000000000000..ca123ef819ca1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesListSamples.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.appplatform.generated.generated; + +/** Samples for ServiceRegistries List. */ +public final class ServiceRegistriesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/ServiceRegistries_List.json + */ + /** + * Sample code: ServiceRegistries_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void serviceRegistriesList( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.serviceRegistries().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCheckNameAvailabilitySamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..76c6b7f825bb7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCheckNameAvailabilitySamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.NameAvailabilityParameters; + +/** Samples for Services CheckNameAvailability. */ +public final class ServicesCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CheckNameAvailability.json + */ + /** + * Sample code: Services_CheckNameAvailability. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCheckNameAvailability( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .checkNameAvailabilityWithResponse( + "eastus", + new NameAvailabilityParameters().withType("Microsoft.AppPlatform/Spring").withName("myservice"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..9ec4d5882f0d7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCreateOrUpdateSamples.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.IngressConfig; +import com.azure.resourcemanager.appplatform.generated.models.MarketplaceResource; +import com.azure.resourcemanager.appplatform.generated.models.NetworkProfile; +import com.azure.resourcemanager.appplatform.generated.models.ServiceVNetAddons; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.azure.resourcemanager.appplatform.generated.models.WeekDay; +import com.azure.resourcemanager.appplatform.generated.models.WeeklyMaintenanceScheduleConfiguration; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services CreateOrUpdate. */ +public final class ServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate_Consumption.json + */ + /** + * Sample code: Services_CreateOrUpdate_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdateConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withManagedEnvironmentId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment")) + .withSku(new Sku().withName("S0").withTier("StandardGen2")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json + */ + /** + * Sample code: Services_CreateOrUpdate_VNetInjection. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdateVNetInjection( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withNetworkProfile( + new NetworkProfile() + .withServiceRuntimeSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime") + .withAppSubnetId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps") + .withServiceCidr("10.8.0.0/16,10.244.0.0/16,10.245.0.1/16") + .withServiceRuntimeNetworkResourceGroup("my-service-runtime-network-rg") + .withAppNetworkResourceGroup("my-app-network-rg") + .withIngressConfig(new IngressConfig().withReadTimeoutInSeconds(300))) + .withVnetAddons( + new ServiceVNetAddons().withLogStreamPublicEndpoint(true).withDataPlanePublicEndpoint(true))) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate.json + */ + /** + * Sample code: Services_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withMaintenanceScheduleConfiguration( + new WeeklyMaintenanceScheduleConfiguration().withHour(10).withDay(WeekDay.SUNDAY))) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_CreateOrUpdate_Enterprise.json + */ + /** + * Sample code: Services_CreateOrUpdate_Enterprise. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesCreateOrUpdateEnterprise( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .define("myservice") + .withRegion("eastus") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties( + new ClusterResourceProperties() + .withMarketplaceResource( + new MarketplaceResource() + .withPlan("tanzu-asc-ent-mtr") + .withPublisher("vmware-inc") + .withProduct("azure-spring-cloud-vmware-tanzu-2"))) + .withSku(new Sku().withName("E0").withTier("Enterprise")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDeleteSamples.java new file mode 100644 index 0000000000000..a1dad9a167323 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Delete.json + */ + /** + * Sample code: Services_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().delete("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDisableApmGloballySamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDisableApmGloballySamples.java new file mode 100644 index 0000000000000..e833c025edcc1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDisableApmGloballySamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; + +/** Samples for Services DisableApmGlobally. */ +public final class ServicesDisableApmGloballySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_DisableApmGlobally.json + */ + /** + * Sample code: Services_DisableApmGlobally. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesDisableApmGlobally( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .disableApmGlobally( + "myResourceGroup", + "myservice", + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDisableTestEndpointSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDisableTestEndpointSamples.java new file mode 100644 index 0000000000000..50838ebdffff0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDisableTestEndpointSamples.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.appplatform.generated.generated; + +/** Samples for Services DisableTestEndpoint. */ +public final class ServicesDisableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_DisableTestEndpoint.json + */ + /** + * Sample code: Services_DisableTestEndpoint. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesDisableTestEndpoint( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .disableTestEndpointWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesEnableApmGloballySamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesEnableApmGloballySamples.java new file mode 100644 index 0000000000000..81ac8f35a3968 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesEnableApmGloballySamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ApmReference; + +/** Samples for Services EnableApmGlobally. */ +public final class ServicesEnableApmGloballySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_EnableApmGlobally.json + */ + /** + * Sample code: Services_EnableApmGlobally. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesEnableApmGlobally( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .enableApmGlobally( + "myResourceGroup", + "myservice", + new ApmReference() + .withResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apms/myappinsights"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesEnableTestEndpointSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesEnableTestEndpointSamples.java new file mode 100644 index 0000000000000..92f7490bdcdc1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesEnableTestEndpointSamples.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.appplatform.generated.generated; + +/** Samples for Services EnableTestEndpoint. */ +public final class ServicesEnableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_EnableTestEndpoint.json + */ + /** + * Sample code: Services_EnableTestEndpoint. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesEnableTestEndpoint( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .enableTestEndpointWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesFlushVnetDnsSettingSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesFlushVnetDnsSettingSamples.java new file mode 100644 index 0000000000000..1c931f1a85fec --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesFlushVnetDnsSettingSamples.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.appplatform.generated.generated; + +/** Samples for Services FlushVnetDnsSetting. */ +public final class ServicesFlushVnetDnsSettingSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_FlushVnetDnsSetting.json + */ + /** + * Sample code: Services_FlushVnetDnsSetting. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesFlushVnetDnsSetting( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().flushVnetDnsSetting("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesGetByResourceGroupSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..d60b76dd3f3aa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesGetByResourceGroupSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Get.json + */ + /** + * Sample code: Services_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .getByResourceGroupWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Get_Consumption.json + */ + /** + * Sample code: Services_Get_Consumption. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesGetConsumption( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .getByResourceGroupWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListByResourceGroupSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..2d252c4bc4c0c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListByResourceGroupSamples.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.appplatform.generated.generated; + +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_List.json + */ + /** + * Sample code: Services_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListGloballyEnabledApmsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListGloballyEnabledApmsSamples.java new file mode 100644 index 0000000000000..7f51ae97cdf21 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListGloballyEnabledApmsSamples.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.appplatform.generated.generated; + +/** Samples for Services ListGloballyEnabledApms. */ +public final class ServicesListGloballyEnabledApmsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListGloballyEnabledApms.json + */ + /** + * Sample code: Services_ListGloballyEnabledApms. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListGloballyEnabledApms( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .listGloballyEnabledApmsWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSamples.java new file mode 100644 index 0000000000000..3610538bbb745 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSamples.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.appplatform.generated.generated; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListBySubscription.json + */ + /** + * Sample code: Services_ListBySubscription. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListBySubscription( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSupportedApmTypesSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSupportedApmTypesSamples.java new file mode 100644 index 0000000000000..e37078b6278e7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSupportedApmTypesSamples.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.appplatform.generated.generated; + +/** Samples for Services ListSupportedApmTypes. */ +public final class ServicesListSupportedApmTypesSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListSupportedApmTypes.json + */ + /** + * Sample code: Services_ListSupportedApmTypes. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListSupportedApmTypes( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().listSupportedApmTypes("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSupportedServerVersionsSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSupportedServerVersionsSamples.java new file mode 100644 index 0000000000000..47613750fbeba --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSupportedServerVersionsSamples.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.appplatform.generated.generated; + +/** Samples for Services ListSupportedServerVersions. */ +public final class ServicesListSupportedServerVersionsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListSupportedServerVersions.json + */ + /** + * Sample code: Services_ListSupportedServerVersions. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListSupportedServerVersions( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .listSupportedServerVersions("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListTestKeysSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListTestKeysSamples.java new file mode 100644 index 0000000000000..549ac75a5960f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListTestKeysSamples.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.appplatform.generated.generated; + +/** Samples for Services ListTestKeys. */ +public final class ServicesListTestKeysSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_ListTestKeys.json + */ + /** + * Sample code: Services_ListTestKeys. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesListTestKeys( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().listTestKeysWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesRegenerateTestKeySamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesRegenerateTestKeySamples.java new file mode 100644 index 0000000000000..325c975e16441 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesRegenerateTestKeySamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; +import com.azure.resourcemanager.appplatform.generated.models.TestKeyType; + +/** Samples for Services RegenerateTestKey. */ +public final class ServicesRegenerateTestKeySamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_RegenerateTestKey.json + */ + /** + * Sample code: Services_RegenerateTestKey. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesRegenerateTestKey( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .services() + .regenerateTestKeyWithResponse( + "myResourceGroup", + "myservice", + new RegenerateTestKeyRequestPayload().withKeyType(TestKeyType.PRIMARY), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStartSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStartSamples.java new file mode 100644 index 0000000000000..d5e72d8994824 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStartSamples.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.appplatform.generated.generated; + +/** Samples for Services Start. */ +public final class ServicesStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Start.json + */ + /** + * Sample code: Services_Start. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesStart(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().start("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStopSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStopSamples.java new file mode 100644 index 0000000000000..89bf36b909bcc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStopSamples.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.appplatform.generated.generated; + +/** Samples for Services Stop. */ +public final class ServicesStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Stop.json + */ + /** + * Sample code: Services_Stop. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesStop(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.services().stop("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesUpdateSamples.java new file mode 100644 index 0000000000000..0dd28f5613777 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesUpdateSamples.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.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ServiceResource; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Services Update. */ +public final class ServicesUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Services_Update.json + */ + /** + * Sample code: Services_Update. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void servicesUpdate(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + ServiceResource resource = + manager + .services() + .getByResourceGroupWithResponse("myResourceGroup", "myservice", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withProperties(new ClusterResourceProperties()) + .withSku(new Sku().withName("S0").withTier("Standard")) + .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/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/SkusListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/SkusListSamples.java new file mode 100644 index 0000000000000..03b917c2392cc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/SkusListSamples.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.appplatform.generated.generated; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Skus_List.json + */ + /** + * Sample code: Skus_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void skusList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.skus().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesCreateOrUpdateSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..31c1edbfba1cd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.generated; + +import com.azure.resourcemanager.appplatform.generated.models.StorageAccount; + +/** Samples for Storages CreateOrUpdate. */ +public final class StoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_CreateOrUpdate.json + */ + /** + * Sample code: Storages_CreateOrUpdate. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesCreateOrUpdate( + com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .storages() + .define("mystorage") + .withExistingSpring("myResourceGroup", "myservice") + .withProperties( + new StorageAccount().withAccountName("storage-account-name").withAccountKey("fakeTokenPlaceholder")) + .create(); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesDeleteSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesDeleteSamples.java new file mode 100644 index 0000000000000..126073f02d9ad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesDeleteSamples.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.appplatform.generated.generated; + +/** Samples for Storages Delete. */ +public final class StoragesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_Delete.json + */ + /** + * Sample code: Storages_Delete. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesDelete(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.storages().delete("myResourceGroup", "myservice", "mystorage", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesGetSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesGetSamples.java new file mode 100644 index 0000000000000..3c53b66c26c99 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesGetSamples.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.appplatform.generated.generated; + +/** Samples for Storages Get. */ +public final class StoragesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_Get.json + */ + /** + * Sample code: Storages_Get. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesGet(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager + .storages() + .getWithResponse("myResourceGroup", "myservice", "mystorage", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesListSamples.java b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesListSamples.java new file mode 100644 index 0000000000000..98a3dafd9047c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesListSamples.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.appplatform.generated.generated; + +/** Samples for Storages List. */ +public final class StoragesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-11-01-preview/examples/Storages_List.json + */ + /** + * Sample code: Storages_List. + * + * @param manager Entry point to AppPlatformManager. + */ + public static void storagesList(com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager) { + manager.storages().list("myResourceGroup", "myservice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appplatform/ci.yml b/sdk/appplatform/ci.yml new file mode 100644 index 0000000000000..f0efdb56219a1 --- /dev/null +++ b/sdk/appplatform/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/appplatform/ci.yml + - sdk/appplatform/azure-resourcemanager-appplatform-generated/ + exclude: + - sdk/appplatform/pom.xml + - sdk/appplatform/azure-resourcemanager-appplatform-generated/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.yml + - sdk/appplatform/azure-resourcemanager-appplatform-generated/ + exclude: + - sdk/appplatform/pom.xml + - sdk/appplatform/azure-resourcemanager-appplatform-generated/pom.xml + +parameters: + - name: release_azureresourcemanagerappplatformgenerated + displayName: azure-resourcemanager-appplatform-generated + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: appplatform + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-appplatform-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerappplatformgenerated + releaseInBatch: ${{ parameters.release_azureresourcemanagerappplatformgenerated }} diff --git a/sdk/appplatform/pom.xml b/sdk/appplatform/pom.xml new file mode 100644 index 0000000000000..fef1bd7fd4a04 --- /dev/null +++ b/sdk/appplatform/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-appplatform-service + pom + 1.0.0 + + + azure-resourcemanager-appplatform-generated + +