diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 380acbed43419..9359dfe515990 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oep;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.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index efafdfe5c9411..c249003b95334 100644 --- a/pom.xml +++ b/pom.xml @@ -720,6 +720,7 @@ sdk/apimanagement sdk/appconfiguration 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..90ca85798c6bc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-02-02) + +- Azure Resource Manager AppPlatform client library for Java. This package contains Microsoft Azure SDK for AppPlatform Management SDK. REST API for Azure Spring Cloud. Package tag package-preview-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/README.md b/sdk/appplatform/azure-resourcemanager-appplatform-generated/README.md new file mode 100644 index 0000000000000..807ad4ed9c03c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/README.md @@ -0,0 +1,102 @@ +# 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 Cloud. Package tag package-preview-2022-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-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] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +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](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/appplatform/azure-resourcemanager-appplatform-generated/SAMPLE.md b/sdk/appplatform/azure-resourcemanager-appplatform-generated/SAMPLE.md new file mode 100644 index 0000000000000..8c0e16feed468 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/SAMPLE.md @@ -0,0 +1,3507 @@ +# 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) + +## 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 + +- [CreateOrUpdateBuild](#buildservice_createorupdatebuild) +- [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) + +## BuildpackBinding + +- [CreateOrUpdate](#buildpackbinding_createorupdate) +- [Delete](#buildpackbinding_delete) +- [Get](#buildpackbinding_get) +- [List](#buildpackbinding_list) + +## 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) + +## CustomDomains + +- [CreateOrUpdate](#customdomains_createorupdate) +- [Delete](#customdomains_delete) +- [Get](#customdomains_get) +- [List](#customdomains_list) +- [Update](#customdomains_update) + +## Deployments + +- [CreateOrUpdate](#deployments_createorupdate) +- [Delete](#deployments_delete) +- [GenerateHeapDump](#deployments_generateheapdump) +- [GenerateThreadDump](#deployments_generatethreaddump) +- [Get](#deployments_get) +- [GetLogFileUrl](#deployments_getlogfileurl) +- [List](#deployments_list) +- [ListForCluster](#deployments_listforcluster) +- [Restart](#deployments_restart) +- [Start](#deployments_start) +- [StartJfr](#deployments_startjfr) +- [Stop](#deployments_stop) +- [Update](#deployments_update) + +## 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) +- [ValidateDomain](#gateways_validatedomain) + +## MonitoringSettings + +- [Get](#monitoringsettings_get) +- [UpdatePatch](#monitoringsettings_updatepatch) +- [UpdatePut](#monitoringsettings_updateput) + +## Operations + +- [List](#operations_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) +- [DisableTestEndpoint](#services_disabletestendpoint) +- [EnableTestEndpoint](#services_enabletestendpoint) +- [GetByResourceGroup](#services_getbyresourcegroup) +- [List](#services_list) +- [ListByResourceGroup](#services_listbyresourcegroup) +- [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/2022-01-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 +import com.azure.core.util.Context; + +/** Samples for ApiPortalCustomDomains Delete. */ +public final class ApiPortalCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ApiPortalCustomDomains_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ApiPortalCustomDomains Get. */ +public final class ApiPortalCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ApiPortalCustomDomains_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApiPortalCustomDomains List. */ +public final class ApiPortalCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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/2022-01-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 +import com.azure.core.util.Context; + +/** Samples for ApiPortals Delete. */ +public final class ApiPortalsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ApiPortals_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ApiPortals Get. */ +public final class ApiPortalsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ApiPortals_List + +```java +import com.azure.core.util.Context; + +/** Samples for ApiPortals List. */ +public final class ApiPortalsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ApiPortals_ValidateDomain + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + Context.NONE); + } +} +``` + +### Apps_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +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.PersistentDisk; +import com.azure.resourcemanager.appplatform.generated.models.TemporaryDisk; +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/2022-01-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"))) + .withFqdn("myapp.mydomain.com") + .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)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Apps_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Apps Delete. */ +public final class AppsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Apps_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Apps Get. */ +public final class AppsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, Context.NONE); + } +} +``` + +### Apps_GetResourceUploadUrl + +```java +import com.azure.core.util.Context; + +/** Samples for Apps GetResourceUploadUrl. */ +public final class AppsGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Apps_List + +```java +import com.azure.core.util.Context; + +/** Samples for Apps List. */ +public final class AppsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Apps_SetActiveDeployments + +```java +import com.azure.core.util.Context; +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/2022-01-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")), + Context.NONE); + } +} +``` + +### Apps_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.models.AppResource; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +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 java.util.Arrays; + +/** Samples for Apps Update. */ +public final class AppsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, Context.NONE).getValue(); + resource + .update() + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withFqdn("myapp.mydomain.com") + .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)) + .apply(); + } +} +``` + +### Apps_ValidateDomain + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + 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/2022-01-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("xxxx") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Bindings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Bindings Delete. */ +public final class BindingsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Bindings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Bindings Get. */ +public final class BindingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Bindings_List + +```java +import com.azure.core.util.Context; + +/** Samples for Bindings List. */ +public final class BindingsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Bindings_Update + +```java +import com.azure.core.util.Context; +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/2022-01-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", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new BindingResourceProperties() + .withKey("xxxx") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BuildService_CreateOrUpdateBuild + +```java +import com.azure.resourcemanager.appplatform.generated.models.BuildProperties; +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/2022-01-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() + .define("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"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### BuildService_GetBuild + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuild. */ +public final class BuildServiceGetBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_GetBuildResult + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuildResult. */ +public final class BuildServiceGetBuildResultSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_GetBuildResultLog + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuildResultLog. */ +public final class BuildServiceGetBuildResultLogSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_GetBuildService + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuildService. */ +public final class BuildServiceGetBuildServiceSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_GetResourceUploadUrl + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetResourceUploadUrl. */ +public final class BuildServiceGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_GetSupportedBuildpack + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetSupportedBuildpack. */ +public final class BuildServiceGetSupportedBuildpackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_GetSupportedStack + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService GetSupportedStack. */ +public final class BuildServiceGetSupportedStackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_ListBuildResults + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService ListBuildResults. */ +public final class BuildServiceListBuildResultsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_ListBuildServices + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService ListBuildServices. */ +public final class BuildServiceListBuildServicesSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_ListBuilds + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService ListBuilds. */ +public final class BuildServiceListBuildsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_ListSupportedBuildpacks + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService ListSupportedBuildpacks. */ +public final class BuildServiceListSupportedBuildpacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildService_ListSupportedStacks + +```java +import com.azure.core.util.Context; + +/** Samples for BuildService ListSupportedStacks. */ +public final class BuildServiceListSupportedStacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildServiceAgentPool_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BuildServiceAgentPool Get. */ +public final class BuildServiceAgentPoolGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildServiceAgentPool_List + +```java +import com.azure.core.util.Context; + +/** Samples for BuildServiceAgentPool List. */ +public final class BuildServiceAgentPoolListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildServiceAgentPool_UpdatePut + +```java +import com.azure.core.util.Context; +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/2022-01-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"))), + 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/2022-01-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 +import com.azure.core.util.Context; + +/** Samples for BuildServiceBuilder Delete. */ +public final class BuildServiceBuilderDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildServiceBuilder_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BuildServiceBuilder Get. */ +public final class BuildServiceBuilderGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildServiceBuilder_List + +```java +import com.azure.core.util.Context; + +/** Samples for BuildServiceBuilder List. */ +public final class BuildServiceBuilderListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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/2022-01-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(); + } + + @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 +import com.azure.core.util.Context; + +/** Samples for BuildpackBinding Delete. */ +public final class BuildpackBindingDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildpackBinding_Get + +```java +import com.azure.core.util.Context; + +/** Samples for BuildpackBinding Get. */ +public final class BuildpackBindingGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### BuildpackBinding_List + +```java +import com.azure.core.util.Context; + +/** Samples for BuildpackBinding List. */ +public final class BuildpackBindingListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Certificates_CreateOrUpdate + +```java +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/2022-01-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("mycert") + .withCertVersion("08a219d06d874795a96db47e06fbb01e")) + .create(); + } +} +``` + +### Certificates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Certificates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Certificates_List + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ConfigServers_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ConfigServers Get. */ +public final class ConfigServersGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ConfigServers_UpdatePatch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +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/2022-01-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("/"))))), + Context.NONE); + } +} +``` + +### ConfigServers_UpdatePut + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +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/2022-01-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("/"))))), + Context.NONE); + } +} +``` + +### ConfigServers_Validate + +```java +import com.azure.core.util.Context; +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/2022-01-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("/"))), + 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/2022-01-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 +import com.azure.core.util.Context; + +/** Samples for ConfigurationServices Delete. */ +public final class ConfigurationServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ConfigurationServices_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ConfigurationServices Get. */ +public final class ConfigurationServicesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ConfigurationServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for ConfigurationServices List. */ +public final class ConfigurationServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ConfigurationServices_Validate + +```java +import com.azure.core.util.Context; +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/2022-01-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")))), + 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/2022-01-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 +import com.azure.core.util.Context; + +/** Samples for CustomDomains Delete. */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### CustomDomains_Get + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains Get. */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### CustomDomains_List + +```java +import com.azure.core.util.Context; + +/** Samples for CustomDomains List. */ +public final class CustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### CustomDomains_Update + +```java +import com.azure.core.util.Context; +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/2022-01-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", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new CustomDomainProperties() + .withThumbprint("934367bf1c97033f877db0f15cb1b586957d3133") + .withCertName("mycert")) + .apply(); + } +} +``` + +### Deployments_CreateOrUpdate + +```java +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +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.ImageRegistryCredential; +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/2022-01-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")) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "patterns", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("[\"mypattern\"]", Object.class, SerializerEncoding.JSON)))))) + .withSku(new Sku().withName("S0").withTier("Standard").withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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("myPassword")))) + .withDeploymentSettings( + new DeploymentSettings() + .withResourceRequests(new ResourceRequests().withCpu("1000m").withMemory("3Gi")) + .withEnvironmentVariables(mapOf("env", "test")))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Deployments_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments Delete. */ +public final class DeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Deployments_GenerateHeapDump + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + Context.NONE); + } +} +``` + +### Deployments_GenerateThreadDump + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + Context.NONE); + } +} +``` + +### Deployments_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments Get. */ +public final class DeploymentsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Deployments_GetLogFileUrl + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments GetLogFileUrl. */ +public final class DeploymentsGetLogFileUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Deployments_List + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments List. */ +public final class DeploymentsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, Context.NONE); + } +} +``` + +### Deployments_ListForCluster + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments ListForCluster. */ +public final class DeploymentsListForClusterSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, Context.NONE); + } +} +``` + +### Deployments_Restart + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments Restart. */ +public final class DeploymentsRestartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Deployments_Start + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments Start. */ +public final class DeploymentsStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Deployments_StartJfr + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + Context.NONE); + } +} +``` + +### Deployments_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for Deployments Stop. */ +public final class DeploymentsStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Deployments_Update + +```java +import com.azure.core.util.Context; +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/2022-01-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", 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/2022-01-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", 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(""))))) + .apply(); + } +} +``` + +### 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/2022-01-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 +import com.azure.core.util.Context; + +/** Samples for GatewayCustomDomains Delete. */ +public final class GatewayCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### GatewayCustomDomains_Get + +```java +import com.azure.core.util.Context; + +/** Samples for GatewayCustomDomains Get. */ +public final class GatewayCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### GatewayCustomDomains_List + +```java +import com.azure.core.util.Context; + +/** Samples for GatewayCustomDomains List. */ +public final class GatewayCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### GatewayRouteConfigs_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.GatewayApiRoute; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import java.util.Arrays; + +/** Samples for GatewayRouteConfigs CreateOrUpdate. */ +public final class GatewayRouteConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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") + .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 +import com.azure.core.util.Context; + +/** Samples for GatewayRouteConfigs Delete. */ +public final class GatewayRouteConfigsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### GatewayRouteConfigs_Get + +```java +import com.azure.core.util.Context; + +/** Samples for GatewayRouteConfigs Get. */ +public final class GatewayRouteConfigsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### GatewayRouteConfigs_List + +```java +import com.azure.core.util.Context; + +/** Samples for GatewayRouteConfigs List. */ +public final class GatewayRouteConfigsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Gateways_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +/** Samples for Gateways CreateOrUpdate. */ +public final class GatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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) + .withResourceRequests(new GatewayResourceRequests().withCpu("1").withMemory("1G"))) + .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)) + .create(); + } +} +``` + +### Gateways_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Gateways Delete. */ +public final class GatewaysDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Gateways_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Gateways Get. */ +public final class GatewaysGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Gateways_List + +```java +import com.azure.core.util.Context; + +/** Samples for Gateways List. */ +public final class GatewaysListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Gateways_ValidateDomain + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + Context.NONE); + } +} +``` + +### MonitoringSettings_Get + +```java +import com.azure.core.util.Context; + +/** Samples for MonitoringSettings Get. */ +public final class MonitoringSettingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### MonitoringSettings_UpdatePatch + +```java +import com.azure.core.util.Context; +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/2022-01-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("00000000-0000-0000-0000-000000000000") + .withAppInsightsSamplingRate(10.0)), + Context.NONE); + } +} +``` + +### MonitoringSettings_UpdatePut + +```java +import com.azure.core.util.Context; +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/2022-01-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("00000000-0000-0000-0000-000000000000") + .withAppInsightsSamplingRate(10.0)), + Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(Context.NONE); + } +} +``` + +### RuntimeVersions_ListRuntimeVersions + +```java +import com.azure.core.util.Context; + +/** Samples for RuntimeVersions ListRuntimeVersions. */ +public final class RuntimeVersionsListRuntimeVersionsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(Context.NONE); + } +} +``` + +### ServiceRegistries_CreateOrUpdate + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries CreateOrUpdate. */ +public final class ServiceRegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ServiceRegistries_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries Delete. */ +public final class ServiceRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ServiceRegistries_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries Get. */ +public final class ServiceRegistriesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### ServiceRegistries_List + +```java +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries List. */ +public final class ServiceRegistriesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_CheckNameAvailability + +```java +import com.azure.core.util.Context; +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/2022-01-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"), + Context.NONE); + } +} +``` + +### Services_CreateOrUpdate + +```java +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.NetworkProfile; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +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/2022-01-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", "value1")) + .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"))) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", "value1")) + .withProperties(new ClusterResourceProperties()) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Services_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_DisableTestEndpoint + +```java +import com.azure.core.util.Context; + +/** Samples for Services DisableTestEndpoint. */ +public final class ServicesDisableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_EnableTestEndpoint + +```java +import com.azure.core.util.Context; + +/** Samples for Services EnableTestEndpoint. */ +public final class ServicesEnableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_List + +```java +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(Context.NONE); + } +} +``` + +### Services_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_ListTestKeys + +```java +import com.azure.core.util.Context; + +/** Samples for Services ListTestKeys. */ +public final class ServicesListTestKeysSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_RegenerateTestKey + +```java +import com.azure.core.util.Context; +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/2022-01-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), + Context.NONE); + } +} +``` + +### Services_Start + +```java +import com.azure.core.util.Context; + +/** Samples for Services Start. */ +public final class ServicesStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_Stop + +```java +import com.azure.core.util.Context; + +/** Samples for Services Stop. */ +public final class ServicesStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Services_Update + +```java +import com.azure.core.util.Context; +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/2022-01-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", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("key1", "value1")) + .withProperties(new ClusterResourceProperties()) + .withSku(new Sku().withName("S0").withTier("Standard")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Skus_List + +```java +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(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/2022-01-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("account-key-of-storage-account")) + .create(); + } +} +``` + +### Storages_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Storages Delete. */ +public final class StoragesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Storages_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Storages Get. */ +public final class StoragesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} +``` + +### Storages_List + +```java +import com.azure.core.util.Context; + +/** Samples for Storages List. */ +public final class StoragesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..12461a626de4c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-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 Cloud. Package tag package-preview-2022-01. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.24.1 + + + com.azure + azure-core-management + 1.5.1 + + + 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..b624f6f17d5f9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/AppPlatformManager.java @@ -0,0 +1,508 @@ +// Copyright (c) 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.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.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.AppPlatformManagementClientBuilder; +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.CustomDomainsImpl; +import com.azure.resourcemanager.appplatform.generated.implementation.DeploymentsImpl; +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.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.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.CustomDomains; +import com.azure.resourcemanager.appplatform.generated.models.Deployments; +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.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 Cloud. */ +public final class AppPlatformManager { + private Services services; + + private ConfigServers configServers; + + private ConfigurationServices configurationServices; + + private ServiceRegistries serviceRegistries; + + 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 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); + } + + /** + * 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 final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of 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) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + 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); + } + } + + /** @return Resource collection API of Services. */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(clientObject.getServices(), this); + } + return services; + } + + /** @return Resource collection API of ConfigServers. */ + public ConfigServers configServers() { + if (this.configServers == null) { + this.configServers = new ConfigServersImpl(clientObject.getConfigServers(), this); + } + return configServers; + } + + /** @return Resource collection API of ConfigurationServices. */ + public ConfigurationServices configurationServices() { + if (this.configurationServices == null) { + this.configurationServices = new ConfigurationServicesImpl(clientObject.getConfigurationServices(), this); + } + return configurationServices; + } + + /** @return Resource collection API of ServiceRegistries. */ + public ServiceRegistries serviceRegistries() { + if (this.serviceRegistries == null) { + this.serviceRegistries = new ServiceRegistriesImpl(clientObject.getServiceRegistries(), this); + } + return serviceRegistries; + } + + /** @return Resource collection API of BuildServices. */ + public BuildServices buildServices() { + if (this.buildServices == null) { + this.buildServices = new BuildServicesImpl(clientObject.getBuildServices(), this); + } + return buildServices; + } + + /** @return Resource collection API of BuildpackBindings. */ + public BuildpackBindings buildpackBindings() { + if (this.buildpackBindings == null) { + this.buildpackBindings = new BuildpackBindingsImpl(clientObject.getBuildpackBindings(), this); + } + return buildpackBindings; + } + + /** @return Resource collection API of BuildServiceBuilders. */ + public BuildServiceBuilders buildServiceBuilders() { + if (this.buildServiceBuilders == null) { + this.buildServiceBuilders = new BuildServiceBuildersImpl(clientObject.getBuildServiceBuilders(), this); + } + return buildServiceBuilders; + } + + /** @return Resource collection API of BuildServiceAgentPools. */ + public BuildServiceAgentPools buildServiceAgentPools() { + if (this.buildServiceAgentPools == null) { + this.buildServiceAgentPools = + new BuildServiceAgentPoolsImpl(clientObject.getBuildServiceAgentPools(), this); + } + return buildServiceAgentPools; + } + + /** @return Resource collection API of MonitoringSettings. */ + public MonitoringSettings monitoringSettings() { + if (this.monitoringSettings == null) { + this.monitoringSettings = new MonitoringSettingsImpl(clientObject.getMonitoringSettings(), this); + } + return monitoringSettings; + } + + /** @return Resource collection API of Apps. */ + public Apps apps() { + if (this.apps == null) { + this.apps = new AppsImpl(clientObject.getApps(), this); + } + return apps; + } + + /** @return Resource collection API of Bindings. */ + public Bindings bindings() { + if (this.bindings == null) { + this.bindings = new BindingsImpl(clientObject.getBindings(), this); + } + return bindings; + } + + /** @return Resource collection API of Storages. */ + public Storages storages() { + if (this.storages == null) { + this.storages = new StoragesImpl(clientObject.getStorages(), this); + } + return storages; + } + + /** @return Resource collection API of Certificates. */ + public Certificates certificates() { + if (this.certificates == null) { + this.certificates = new CertificatesImpl(clientObject.getCertificates(), this); + } + return certificates; + } + + /** @return Resource collection API of CustomDomains. */ + public CustomDomains customDomains() { + if (this.customDomains == null) { + this.customDomains = new CustomDomainsImpl(clientObject.getCustomDomains(), this); + } + return customDomains; + } + + /** @return Resource collection API of Deployments. */ + public Deployments deployments() { + if (this.deployments == null) { + this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this); + } + return deployments; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of RuntimeVersions. */ + public RuntimeVersions runtimeVersions() { + if (this.runtimeVersions == null) { + this.runtimeVersions = new RuntimeVersionsImpl(clientObject.getRuntimeVersions(), this); + } + return runtimeVersions; + } + + /** @return Resource collection API of Skus. */ + public Skus skus() { + if (this.skus == null) { + this.skus = new SkusImpl(clientObject.getSkus(), this); + } + return skus; + } + + /** @return Resource collection API of Gateways. */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + + /** @return Resource collection API of GatewayRouteConfigs. */ + public GatewayRouteConfigs gatewayRouteConfigs() { + if (this.gatewayRouteConfigs == null) { + this.gatewayRouteConfigs = new GatewayRouteConfigsImpl(clientObject.getGatewayRouteConfigs(), this); + } + return gatewayRouteConfigs; + } + + /** @return Resource collection API of GatewayCustomDomains. */ + public GatewayCustomDomains gatewayCustomDomains() { + if (this.gatewayCustomDomains == null) { + this.gatewayCustomDomains = new GatewayCustomDomainsImpl(clientObject.getGatewayCustomDomains(), this); + } + return gatewayCustomDomains; + } + + /** @return Resource collection API of ApiPortals. */ + public ApiPortals apiPortals() { + if (this.apiPortals == null) { + this.apiPortals = new ApiPortalsImpl(clientObject.getApiPortals(), this); + } + return apiPortals; + } + + /** @return Resource collection API of ApiPortalCustomDomains. */ + public ApiPortalCustomDomains apiPortalCustomDomains() { + if (this.apiPortalCustomDomains == null) { + this.apiPortalCustomDomains = + new ApiPortalCustomDomainsImpl(clientObject.getApiPortalCustomDomains(), this); + } + return apiPortalCustomDomains; + } + + /** + * @return Wrapped service client AppPlatformManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + */ + 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..2b22d63f0abce --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalCustomDomainsClient.java @@ -0,0 +1,244 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..0b5cffb17e13b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ApiPortalsClient.java @@ -0,0 +1,262 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..e8a3760e1906e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppPlatformManagementClient.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.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 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 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(); +} 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..16dc7feccb2c8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/AppsClient.java @@ -0,0 +1,439 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..b4f58eb51e838 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BindingsClient.java @@ -0,0 +1,334 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..ec8cb05424293 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceAgentPoolsClient.java @@ -0,0 +1,180 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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..1643ce7c9c985 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServiceBuildersClient.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context); +} 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..a4ce96036868b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildServicesClient.java @@ -0,0 +1,489 @@ +// Copyright (c) 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.util.Context; +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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the 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 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 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 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 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 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 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 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 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 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 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 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); + + /** + * 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); +} 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..4fe95d07818b7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/BuildpackBindingsClient.java @@ -0,0 +1,289 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BuildpackBindingsClient. */ +public interface BuildpackBindingsClient { + /** + * 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..5e82a441acf49 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CertificatesClient.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.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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..92d8d3a9ede67 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigServersClient.java @@ -0,0 +1,249 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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..c9c93e57009a0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ConfigurationServicesClient.java @@ -0,0 +1,323 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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 validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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); +} 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..80008233614e0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/CustomDomainsClient.java @@ -0,0 +1,334 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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/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..16071ab5ad203 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/DeploymentsClient.java @@ -0,0 +1,872 @@ +// Copyright (c) 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.models.DiagnosticParameters; +import java.util.List; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version, 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. + */ + @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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); + + /** + * 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); + + /** + * 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); + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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/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..f052952d80cb0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayCustomDomainsClient.java @@ -0,0 +1,248 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..193efede99d74 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewayRouteConfigsClient.java @@ -0,0 +1,249 @@ +// Copyright (c) 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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..473f4ae90774c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/GatewaysClient.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.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 reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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); + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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); + + /** + * 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. + */ + @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. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..db8604e11a849 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/MonitoringSettingsClient.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.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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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..6c6422f970ece --- /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. + */ + @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. + */ + @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/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..4cdfa1ea1136a --- /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. + * + * @throws com.azure.core.management.exception.ManagementException 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(); + + /** + * 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); +} 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..c23605de29bfa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServiceRegistriesClient.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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. + */ + @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. + */ + @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..795434b8106fc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/ServicesClient.java @@ -0,0 +1,550 @@ +// Copyright (c) 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.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +import com.azure.resourcemanager.appplatform.generated.models.NameAvailabilityParameters; +import com.azure.resourcemanager.appplatform.generated.models.RegenerateTestKeyRequestPayload; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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.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 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.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 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 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 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.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 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.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 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 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, 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..0863f3f893bd0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/SkusClient.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.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 Cloud SKU and a possible link for next set. + */ + @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 Cloud SKU and a possible link for next set. + */ + @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..61d40d03ce534 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/StoragesClient.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.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; +import reactor.core.publisher.Mono; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @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 storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List all the storages of one Azure Spring Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains the 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. + */ + @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..8f4b034957719 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalCustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain of the API portal. */ +@Fluent +public final class ApiPortalCustomDomainResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalCustomDomainResourceInner.class); + + /* + * 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; + + /** + * 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..1ccccdd92290d --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ApiPortalProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** API portal resource. */ +@Fluent +public final class ApiPortalResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalResourceInner.class); + + /* + * 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; + + /** + * 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/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..4f93ed761ff02 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/AppResourceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.ManagedIdentityProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** App resource payload. */ +@Fluent +public final class AppResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceInner.class); + + /* + * 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; + + /** + * 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/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..fee0d09b1ed7f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.SupportedRuntimeVersion; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The AvailableRuntimeVersions model. */ +@Immutable +public final class AvailableRuntimeVersionsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableRuntimeVersionsInner.class); + + /* + * A list of all supported runtime versions. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * 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..3257e1f089db6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BindingResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Binding resource payload. */ +@Fluent +public final class BindingResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceInner.class); + + /* + * 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; + + /** + * 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..4d8f9c2e80cce --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BuildProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build resource payload. */ +@Fluent +public final class BuildInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildInner.class); + + /* + * 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; + + /** + * 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..72466a3f9b393 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build result resource payload. */ +@Fluent +public final class BuildResultInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildResultInner.class); + + /* + * 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; + + /** + * 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..c96be971f1126 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build result log resource properties payload. */ +@Fluent +public final class BuildResultLogInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildResultLogInner.class); + + /* + * The public download URL of this build result log + */ + @JsonProperty(value = "blobUrl") + private String blobUrl; + + /** + * 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..6e320232ff4d5 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceAgentPoolProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The build service agent pool resource. */ +@Fluent +public final class BuildServiceAgentPoolResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceAgentPoolResourceInner.class); + + /* + * 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; + + /** + * 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..0a645df9b2f7a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service resource payload. */ +@Fluent +public final class BuildServiceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceInner.class); + + /* + * 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; + + /** + * 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..920ebe5060e27 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BuilderProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KPack Builder resource. */ +@Fluent +public final class BuilderResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuilderResourceInner.class); + + /* + * 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; + + /** + * 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..09330d3d57527 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.BuildpackBindingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Buildpack Binding Resource object. */ +@Fluent +public final class BuildpackBindingResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildpackBindingResourceInner.class); + + /* + * 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; + + /** + * 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..75b84432fa119 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.CertificateProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate resource payload. */ +@Fluent +public final class CertificateResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateResourceInner.class); + + /* + * 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; + + /** + * 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..289ec1d9c0d9e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigServerResourceInner.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.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Config Server resource. */ +@Fluent +public final class ConfigServerResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerResourceInner.class); + + /* + * Properties of the Config Server resource + */ + @JsonProperty(value = "properties") + private ConfigServerProperties properties; + + /** + * 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; + } + + /** + * 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..658c76ae21397 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ConfigServerSettingsErrorRecord; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validation result for config server settings. */ +@Fluent +public final class ConfigServerSettingsValidateResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerSettingsValidateResultInner.class); + + /* + * Indicate if the config server settings are valid + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * The detail validation results + */ + @JsonProperty(value = "details") + private List details; + + /** + * 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..d9b0a6329f13a --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Configuration Service resource. */ +@Fluent +public final class ConfigurationServiceResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceResourceInner.class); + + /* + * 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; + + /** + * 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..dae2a3904fdd0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ConfigurationServiceSettingsValidateResultInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ConfigurationServiceGitPropertyValidateResult; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation result for configuration service settings. */ +@Fluent +public final class ConfigurationServiceSettingsValidateResultInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConfigurationServiceSettingsValidateResultInner.class); + + /* + * Validation result for configuration service settings + */ + @JsonProperty(value = "gitPropertyValidationResult") + private ConfigurationServiceGitPropertyValidateResult gitPropertyValidationResult; + + /** + * 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/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..d779461c1d53c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.CustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain resource payload. */ +@Fluent +public final class CustomDomainResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainResourceInner.class); + + /* + * 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; + + /** + * 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..622c8d7a623f0 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Validation result for custom domain. */ +@Fluent +public final class CustomDomainValidateResultInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainValidateResultInner.class); + + /* + * 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; + + /** + * 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/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..23414b1ac8e98 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.DeploymentResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment resource payload. */ +@Fluent +public final class DeploymentResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceInner.class); + + /* + * 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; + + /** + * 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/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..31f6a5a4932f9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.GatewayCustomDomainProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain of the Spring Cloud Gateway. */ +@Fluent +public final class GatewayCustomDomainResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCustomDomainResourceInner.class); + + /* + * 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; + + /** + * 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..d1cf0584fe0c6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Spring Cloud Gateway resource. */ +@Fluent +public final class GatewayResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayResourceInner.class); + + /* + * 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; + + /** + * 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..eb694e53ee512 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Spring Cloud Gateway route config resource. */ +@Fluent +public final class GatewayRouteConfigResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRouteConfigResourceInner.class); + + /* + * 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; + + /** + * 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/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..5e786911b13c2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/LogFileUrlResponseInner.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log file URL payload. */ +@Fluent +public final class LogFileUrlResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogFileUrlResponseInner.class); + + /* + * URL of the log file + */ + @JsonProperty(value = "url", required = true) + private String url; + + /** + * 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")); + } + } +} 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..a3bae9153c33f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.MonitoringSettingProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monitoring Setting resource. */ +@Fluent +public final class MonitoringSettingResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MonitoringSettingResourceInner.class); + + /* + * 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; + + /** + * 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..db729cdf802df --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name availability result payload. */ +@Fluent +public final class NameAvailabilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class); + + /* + * 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; + + /** + * 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..978879fb30731 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/OperationDetailInner.java @@ -0,0 +1,180 @@ +// Copyright (c) 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.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation detail payload. */ +@Fluent +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); + + /* + * 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; + + /** + * 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/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..322d164eddb04 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ResourceSkuInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes an available Azure Spring Cloud SKU. */ +@Fluent +public final class ResourceSkuInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuInner.class); + + /* + * 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; + + /** + * 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..2358469fab536 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource upload definition payload. */ +@Fluent +public final class ResourceUploadDefinitionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUploadDefinitionInner.class); + + /* + * Source relative path + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /* + * Upload URL + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * 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..4d2773d9a9641 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ServiceRegistryProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Service Registry resource. */ +@Fluent +public final class ServiceRegistryResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRegistryResourceInner.class); + + /* + * 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; + + /** + * 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..59962e3abc915 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/fluent/models/ServiceResourceInner.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Service resource. */ +@Fluent +public final class ServiceResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceInner.class); + + /* + * Properties of the Service resource + */ + @JsonProperty(value = "properties") + private ClusterResourceProperties properties; + + /* + * Sku of the Service resource + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * 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; + } + + /** {@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..3de1344172854 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.StorageProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage resource payload. */ +@Fluent +public final class StorageResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageResourceInner.class); + + /* + * 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; + + /** + * 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/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..618d9e09cecbb --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.SupportedBuildpackResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported buildpack resource payload. */ +@Fluent +public final class SupportedBuildpackResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedBuildpackResourceInner.class); + + /* + * 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; + + /** + * 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..535b27ceb687e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedBuildpacksCollectionInner.class); + + /* + * 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; + + /** + * 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/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..6f9efef55e4df --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.models.SupportedStackResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported stack resource payload. */ +@Fluent +public final class SupportedStackResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedStackResourceInner.class); + + /* + * 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; + + /** + * 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..6c7c3800902ed --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedStacksCollectionInner.class); + + /* + * 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; + + /** + * 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..1685df0f801ce --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Test keys payload. */ +@Fluent +public final class TestKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TestKeysInner.class); + + /* + * 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; + + /** + * 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..4027f15b23bdb --- /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 Cloud. */ +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..90ec1299e3be8 --- /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 Cloud. */ +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..71d6c07227fe3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainResourceImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) 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 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..635082996fded --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsClientImpl.java @@ -0,0 +1,1276 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ApiPortalCustomDomainsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, apiPortalName, domainName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource) { + return 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 custom domain of the API portal along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + String domainName, + ApiPortalCustomDomainResourceInner apiPortalCustomDomainResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String apiPortalName, String domainName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String apiPortalName, String domainName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..62ed65017d0bc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalCustomDomainsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiPortalCustomDomainsImpl implements ApiPortalCustomDomains { + @JsonIgnore private 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 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 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 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..da61cea9802f1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalResourceImpl.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.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 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 CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload) { + return serviceManager + .apiPortals() + .validateDomain(resourceGroupName, serviceName, apiPortalName, validatePayload); + } + + public Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context) { + return serviceManager + .apiPortals() + .validateDomainWithResponse(resourceGroupName, serviceName, apiPortalName, validatePayload, context); + } + + 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..dad8c98a7a488 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsClientImpl.java @@ -0,0 +1,1380 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ApiPortalsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, apiPortalName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String apiPortalName, ApiPortalResourceInner apiPortalResource) { + return 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 aPI portal resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ApiPortalResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String apiPortalName, + ApiPortalResourceInner apiPortalResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String apiPortalName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String apiPortalName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 validateDomainAsync(resourceGroupName, serviceName, apiPortalName, validatePayload).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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..20b87326a42ed --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ApiPortalsImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ApiPortalsImpl implements ApiPortals { + @JsonIgnore private 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 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 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 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 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 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 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/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..5f6b686f47a80 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) 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.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the 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 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 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 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() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + AppPlatformManagementClientImpl client = + new AppPlatformManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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..ed04a9287dd13 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppPlatformManagementClientImpl.java @@ -0,0 +1,606 @@ +// Copyright (c) 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.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.AppPlatformManagementClient; +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.CustomDomainsClient; +import com.azure.resourcemanager.appplatform.generated.fluent.DeploymentsClient; +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.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 java.util.Map; +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 { + private final ClientLogger logger = new ClientLogger(AppPlatformManagementClientImpl.class); + + /** + * 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 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 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; + } + + /** + * 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 = "2022-01-01-preview"; + this.services = new ServicesClientImpl(this); + this.configServers = new ConfigServersClientImpl(this); + this.configurationServices = new ConfigurationServicesClientImpl(this); + this.serviceRegistries = new ServiceRegistriesClientImpl(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); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/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..f4dca69799b7a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppResourceImpl.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.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 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 ResourceUploadDefinition getResourceUploadUrl() { + return serviceManager.apps().getResourceUploadUrl(resourceGroupName, serviceName, appName); + } + + public Response getResourceUploadUrlWithResponse(Context context) { + return serviceManager.apps().getResourceUploadUrlWithResponse(resourceGroupName, serviceName, appName, context); + } + + 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 CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload) { + return serviceManager.apps().validateDomain(resourceGroupName, serviceName, appName, validatePayload); + } + + public Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context) { + return serviceManager + .apps() + .validateDomainWithResponse(resourceGroupName, serviceName, appName, validatePayload, context); + } + + 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/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..98aacc30ad7a0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsClientImpl.java @@ -0,0 +1,2237 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(AppsClientImpl.class); + + /** 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") + private 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. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String serviceName, String appName, String syncStatus) { + return getWithResponseAsync(resourceGroupName, serviceName, appName, syncStatus) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, appName, syncStatus).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. + * @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(); + } + + /** + * 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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return 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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, Context context) { + return 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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource) { + return 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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginUpdate( + String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getResourceUploadUrlAsync(resourceGroupName, serviceName, appName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginSetActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection) { + return 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 app resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AppResourceInner> beginSetActiveDeployments( + String resourceGroupName, + String serviceName, + String appName, + ActiveDeploymentCollection activeDeploymentCollection, + Context context) { + return 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 validateDomainAsync(resourceGroupName, serviceName, appName, validatePayload).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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..1231dca6cc12e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/AppsImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class AppsImpl implements Apps { + @JsonIgnore private 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 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 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 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 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 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 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 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 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 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..9cbf0651f3767 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingResourceImpl.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.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 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..1b7057d4f1115 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsClientImpl.java @@ -0,0 +1,1629 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(BindingsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, appName, bindingName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return 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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String bindingName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String bindingName, Context context) { + return 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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource) { + return 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 binding resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BindingResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String bindingName, + BindingResourceInner bindingResource, + Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..3bcce97e8dca7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BindingsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BindingsImpl implements Bindings { + @JsonIgnore private 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 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 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 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..48bd9ecebbdc0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) 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 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..6370da38ca919 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsClientImpl.java @@ -0,0 +1,980 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(BuildServiceAgentPoolsClientImpl.class); + + /** 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, buildServiceName, agentPoolName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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 build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildServiceAgentPoolResourceInner> + beginUpdatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource) { + return 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 build service agent pool resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildServiceAgentPoolResourceInner> + beginUpdatePut( + String resourceGroupName, + String serviceName, + String buildServiceName, + String agentPoolName, + BuildServiceAgentPoolResourceInner agentPoolResource, + Context context) { + return 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 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 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..f2eee9f3e50a5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceAgentPoolsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BuildServiceAgentPoolsImpl implements BuildServiceAgentPools { + @JsonIgnore private 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 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 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 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..613ea60dabf76 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersClientImpl.java @@ -0,0 +1,1268 @@ +// Copyright (c) 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.logging.ClientLogger; +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.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 { + private final ClientLogger logger = new ClientLogger(BuildServiceBuildersClientImpl.class); + + /** 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") + private 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"}) + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, buildServiceName, builderName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource) { + return 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 kPack Builder resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuilderResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + BuilderResourceInner builderResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String buildServiceName, String builderName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, buildServiceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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..bb0a0054165b7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceBuildersImpl.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.BuildServiceBuildersClient; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceBuilders; +import com.azure.resourcemanager.appplatform.generated.models.BuilderResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BuildServiceBuildersImpl implements BuildServiceBuilders { + @JsonIgnore private 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 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 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 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 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..631d491599e88 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServiceImpl.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.BuildServiceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuildService; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceProperties; + +public final class BuildServiceImpl implements BuildService { + private BuildServiceInner innerObject; + + private final com.azure.resourcemanager.appplatform.generated.AppPlatformManager serviceManager; + + BuildServiceImpl( + BuildServiceInner 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 BuildServiceProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BuildServiceInner 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/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..8a59a9365e70c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesClientImpl.java @@ -0,0 +1,3066 @@ +// Copyright (c) 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.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.util.Context; +import com.azure.core.util.FluxUtil; +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.BuildCollection; +import com.azure.resourcemanager.appplatform.generated.models.BuildResultCollection; +import com.azure.resourcemanager.appplatform.generated.models.BuildServiceCollection; +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 { + private final ClientLogger logger = new ClientLogger(BuildServicesClientImpl.class); + + /** 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") + private 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"}) + @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"}) + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getBuildServiceAsync(resourceGroupName, serviceName, buildServiceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 createOrUpdateBuildAsync(resourceGroupName, serviceName, buildServiceName, buildName, build).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getBuildResultAsync(resourceGroupName, serviceName, buildServiceName, buildName, buildResultName) + .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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getBuildResultLogAsync(resourceGroupName, serviceName, buildServiceName, buildName, buildResultName) + .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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getResourceUploadUrlAsync(resourceGroupName, serviceName, buildServiceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listSupportedBuildpacksAsync(resourceGroupName, serviceName, buildServiceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getSupportedBuildpackAsync(resourceGroupName, serviceName, buildServiceName, buildpackName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listSupportedStacksAsync(resourceGroupName, serviceName, buildServiceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getSupportedStackAsync(resourceGroupName, serviceName, buildServiceName, stackName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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 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 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 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 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..148547170d4e3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildServicesImpl.java @@ -0,0 +1,438 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BuildServicesImpl implements BuildServices { + @JsonIgnore private 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + } + + private BuildServicesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appplatform.generated.AppPlatformManager manager() { + return this.serviceManager; + } + + public BuildImpl define(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..8d17c17c042b9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuilderResourceImpl.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.BuilderResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.BuilderProperties; +import com.azure.resourcemanager.appplatform.generated.models.BuilderResource; + +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 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 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..2eb0dbf7770e9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingResourceImpl.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.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 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..f78a4bd294d3c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsClientImpl.java @@ -0,0 +1,1464 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(BuildpackBindingsClientImpl.class); + + /** 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") + private interface BuildpackBindingsService { + @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> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + 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 ManagementException 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @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 buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @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 buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, BuildpackBindingResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + BuildpackBindingResourceInner buildpackBinding) { + return 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 buildpack Binding Resource object along with {@link Response} on successful completion of {@link Mono}. + */ + @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 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String serviceName, + String buildServiceName, + String builderName, + String buildpackBindingName, + Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..c69f9899211bc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/BuildpackBindingsImpl.java @@ -0,0 +1,293 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BuildpackBindingsImpl implements BuildpackBindings { + @JsonIgnore private 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 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 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 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..f8139e58091c1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificateResourceImpl.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.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 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..01773f3c2895b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesClientImpl.java @@ -0,0 +1,1180 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(CertificatesClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, certificateName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CertificateResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource) { + return 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 certificate resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CertificateResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String certificateName, + CertificateResourceInner certificateResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String certificateName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String certificateName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..2a44b79500cb8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CertificatesImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CertificatesImpl implements Certificates { + @JsonIgnore private 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 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 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 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..7e71fe351ddfb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServerResourceImpl.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.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 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..7f126f3eb78a6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersClientImpl.java @@ -0,0 +1,1144 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ConfigServersClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return 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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return 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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource) { + return 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 config Server resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, ConfigServerResourceInner configServerResource, Context context) { + return 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 validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @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 validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerSettingsValidateResultInner> + beginValidate(String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings) { + return 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 validation result for config server settings along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigServerSettingsValidateResultInner> + beginValidate( + String resourceGroupName, String serviceName, ConfigServerSettings configServerSettings, Context context) { + return 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..b3a45df145ce5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigServersImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConfigServersImpl implements ConfigServers { + @JsonIgnore private 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 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 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 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..cc363c1f28a9d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServiceResourceImpl.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.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 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 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..82c3e361b7b48 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesClientImpl.java @@ -0,0 +1,1593 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ConfigurationServicesClientImpl.class); + + /** 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") + private 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"}) + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, configurationServiceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationServiceResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource) { + return 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 application Configuration Service resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ConfigurationServiceResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceResourceInner configurationServiceResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String configurationServiceName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String configurationServiceName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @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 validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings) { + return 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 validation result for configuration service settings along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller< + PollResult, + ConfigurationServiceSettingsValidateResultInner> + beginValidate( + String resourceGroupName, + String serviceName, + String configurationServiceName, + ConfigurationServiceSettings settings, + Context context) { + return 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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..c0a986e08f315 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ConfigurationServicesImpl.java @@ -0,0 +1,238 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ConfigurationServicesImpl implements ConfigurationServices { + @JsonIgnore private 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 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 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 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 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/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..fa42c2960f103 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainResourceImpl.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.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 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..6057715f85bae --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsClientImpl.java @@ -0,0 +1,1638 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(CustomDomainsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, appName, domainName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return 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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String domainName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String domainName, Context context) { + return 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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource) { + return 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 custom domain resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CustomDomainResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String domainName, + CustomDomainResourceInner domainResource, + Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..2710b13bf8770 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/CustomDomainsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class CustomDomainsImpl implements CustomDomains { + @JsonIgnore private 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 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 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 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/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..c77f02e39587b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentResourceImpl.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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.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 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 LogFileUrlResponse getLogFileUrl() { + return serviceManager.deployments().getLogFileUrl(resourceGroupName, serviceName, appName, deploymentName); + } + + public Response getLogFileUrlWithResponse(Context context) { + return serviceManager + .deployments() + .getLogFileUrlWithResponse(resourceGroupName, serviceName, appName, deploymentName, context); + } + + 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..e560bfb2fad2e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsClientImpl.java @@ -0,0 +1,4260 @@ +// Copyright (c) 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.logging.ClientLogger; +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.models.DeploymentResourceCollection; +import com.azure.resourcemanager.appplatform.generated.models.DiagnosticParameters; +import java.nio.ByteBuffer; +import java.util.Collection; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; +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 { + private final ClientLogger logger = new ClientLogger(DeploymentsClientImpl.class); + + /** 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") + private 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, + @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, + @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}/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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, appName, deploymentName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return 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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return 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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource) { + return 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 deployment resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, DeploymentResourceInner> beginUpdate( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DeploymentResourceInner deploymentResource, + Context context) { + return 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter 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 = + Optional + .ofNullable(version) + .map(Collection::stream) + .orElseGet(Stream::empty) + .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, + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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, 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 = + Optional + .ofNullable(version) + .map(Collection::stream) + .orElseGet(Stream::empty) + .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, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version), + 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String serviceName, String appName) { + final List version = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version), + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, serviceName, appName, version, 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String serviceName, String appName) { + final List version = null; + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, serviceName, appName, version, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("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 = + Optional + .ofNullable(version) + .map(Collection::stream) + .orElseGet(Stream::empty) + .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, + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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, 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 = + Optional + .ofNullable(version) + .map(Collection::stream) + .orElseGet(Stream::empty) + .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, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync( + String resourceGroupName, String serviceName, List version) { + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, version), + 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync(String resourceGroupName, String serviceName) { + final List version = null; + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, version), + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listForClusterAsync( + String resourceGroupName, String serviceName, List version, Context context) { + return new PagedFlux<>( + () -> listForClusterSinglePageAsync(resourceGroupName, serviceName, version, 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForCluster(String resourceGroupName, String serviceName) { + final List version = null; + return new PagedIterable<>(listForClusterAsync(resourceGroupName, serviceName, version)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is 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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, Context context) { + return new PagedIterable<>(listForClusterAsync(resourceGroupName, serviceName, version, 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String serviceName, String appName, String deploymentName, Context context) { + return 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(); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getLogFileUrlAsync(resourceGroupName, serviceName, appName, deploymentName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerateHeapDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerateThreadDump( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStartJfr( + String resourceGroupName, + String serviceName, + String appName, + String deploymentName, + DiagnosticParameters diagnosticParameters, + Context context) { + return 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 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 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 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 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..b682b83103abe --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/DeploymentsImpl.java @@ -0,0 +1,361 @@ +// Copyright (c) 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.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.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; + +public final class DeploymentsImpl implements Deployments { + @JsonIgnore private 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 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 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 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, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, serviceName, appName, version, 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, Context context) { + PagedIterable inner = + this.serviceClient().listForCluster(resourceGroupName, serviceName, version, 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 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 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 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/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..abce9e86ebb11 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainResourceImpl.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.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 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..29a2ba8a245fb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsClientImpl.java @@ -0,0 +1,1287 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(GatewayCustomDomainsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, gatewayName, domainName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource) { + return 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 custom domain of the Spring Cloud Gateway along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayCustomDomainResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String domainName, + GatewayCustomDomainResourceInner gatewayCustomDomainResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String gatewayName, String domainName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String gatewayName, String domainName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..e7f2270ea79dc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayCustomDomainsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewayCustomDomainsImpl implements GatewayCustomDomains { + @JsonIgnore private 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 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 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 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..d651c0722bc5c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayResourceImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) 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; + +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 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; + + 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() { + return this; + } + + public GatewayResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createOrUpdate(resourceGroupName, serviceName, gatewayName, this.innerModel(), Context.NONE); + return this; + } + + public GatewayResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getGateways() + .createOrUpdate(resourceGroupName, serviceName, gatewayName, this.innerModel(), 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 CustomDomainValidateResult validateDomain(CustomDomainValidatePayload validatePayload) { + return serviceManager.gateways().validateDomain(resourceGroupName, serviceName, gatewayName, validatePayload); + } + + public Response validateDomainWithResponse( + CustomDomainValidatePayload validatePayload, Context context) { + return serviceManager + .gateways() + .validateDomainWithResponse(resourceGroupName, serviceName, gatewayName, validatePayload, context); + } + + public GatewayResourceImpl withProperties(GatewayProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public GatewayResourceImpl 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/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..dc649003442b1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigResourceImpl.java @@ -0,0 +1,149 @@ +// Copyright (c) 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 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..aea85f70ceb24 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsClientImpl.java @@ -0,0 +1,1291 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(GatewayRouteConfigsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, gatewayName, routeConfigName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @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 spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteConfigResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource) { + return 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 spring Cloud Gateway route config resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayRouteConfigResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + String routeConfigName, + GatewayRouteConfigResourceInner gatewayRouteConfigResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String gatewayName, String routeConfigName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..9582c75fbdbc5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewayRouteConfigsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewayRouteConfigsImpl implements GatewayRouteConfigs { + @JsonIgnore private 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 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 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 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..1f4c60ffb76bf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysClientImpl.java @@ -0,0 +1,1366 @@ +// Copyright (c) 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.logging.ClientLogger; +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 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 GatewaysClient. */ +public final class GatewaysClientImpl implements GatewaysClient { + private final ClientLogger logger = new ClientLogger(GatewaysClientImpl.class); + + /** 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") + private 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"}) + @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"}) + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, gatewayName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String gatewayName, GatewayResourceInner gatewayResource) { + return 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 spring Cloud Gateway resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GatewayResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String gatewayName, + GatewayResourceInner gatewayResource, + Context context) { + return 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(); + } + + /** + * 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String gatewayName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String gatewayName, Context context) { + return 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(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 validateDomainAsync(resourceGroupName, serviceName, gatewayName, validatePayload).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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..2311660e4c2ac --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/GatewaysImpl.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.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 com.fasterxml.jackson.annotation.JsonIgnore; + +public final class GatewaysImpl implements Gateways { + @JsonIgnore private 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 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 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 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 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 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 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 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/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..e91b29c87d4e9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsClientImpl.java @@ -0,0 +1,875 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(MonitoringSettingsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePut( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return 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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePut( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return 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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePatch( + String resourceGroupName, String serviceName, MonitoringSettingResourceInner monitoringSettingResource) { + return 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 monitoring Setting resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MonitoringSettingResourceInner> beginUpdatePatch( + String resourceGroupName, + String serviceName, + MonitoringSettingResourceInner monitoringSettingResource, + Context context) { + return 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..f2c7ac158d2f5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/MonitoringSettingsImpl.java @@ -0,0 +1,112 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class MonitoringSettingsImpl implements MonitoringSettings { + @JsonIgnore private 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 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 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 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..659d3214edf9f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsClientImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final 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") + private 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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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..e3cc0391b9b27 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.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/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..6d14751ee9977 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsClientImpl.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.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.core.util.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(RuntimeVersionsClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listRuntimeVersionsAsync().block(); + } + + /** + * 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(); + } +} 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..e808554124d90 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/RuntimeVersionsImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RuntimeVersionsImpl implements RuntimeVersions { + @JsonIgnore private 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 AvailableRuntimeVersions listRuntimeVersions() { + AvailableRuntimeVersionsInner inner = this.serviceClient().listRuntimeVersions(); + if (inner != null) { + return new AvailableRuntimeVersionsImpl(inner, this.manager()); + } else { + return null; + } + } + + 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; + } + } + + 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..4faed776285db --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesClientImpl.java @@ -0,0 +1,1119 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(ServiceRegistriesClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, serviceRegistryName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName) { + return 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 service Registry resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceRegistryResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String serviceRegistryName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String serviceRegistryName, Context context) { + return 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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 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 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..2b3047fed90f3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceRegistriesImpl.java @@ -0,0 +1,105 @@ +// Copyright (c) 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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServiceRegistriesImpl implements ServiceRegistries { + @JsonIgnore private 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 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 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 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..b3a102e905f64 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServiceResourceImpl.java @@ -0,0 +1,233 @@ +// Copyright (c) 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.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +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 Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + 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 TestKeys listTestKeys() { + return serviceManager.services().listTestKeys(resourceGroupName, serviceName); + } + + public Response listTestKeysWithResponse(Context context) { + return serviceManager.services().listTestKeysWithResponse(resourceGroupName, serviceName, context); + } + + public TestKeys regenerateTestKey(RegenerateTestKeyRequestPayload regenerateTestKeyRequest) { + return serviceManager.services().regenerateTestKey(resourceGroupName, serviceName, regenerateTestKeyRequest); + } + + public Response regenerateTestKeyWithResponse( + RegenerateTestKeyRequestPayload regenerateTestKeyRequest, Context context) { + return serviceManager + .services() + .regenerateTestKeyWithResponse(resourceGroupName, serviceName, regenerateTestKeyRequest, context); + } + + public void disableTestEndpoint() { + serviceManager.services().disableTestEndpoint(resourceGroupName, serviceName); + } + + public Response disableTestEndpointWithResponse(Context context) { + return serviceManager.services().disableTestEndpointWithResponse(resourceGroupName, serviceName, context); + } + + public TestKeys enableTestEndpoint() { + return serviceManager.services().enableTestEndpoint(resourceGroupName, serviceName); + } + + public Response enableTestEndpointWithResponse(Context context) { + return serviceManager.services().enableTestEndpointWithResponse(resourceGroupName, serviceName, context); + } + + 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 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..157a1fc8d1e6a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesClientImpl.java @@ -0,0 +1,2957 @@ +// Copyright (c) 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.logging.ClientLogger; +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.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +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 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 { + private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); + + /** 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") + private 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(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(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}/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("{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); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getByResourceGroupAsync(resourceGroupName, serviceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return 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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String serviceName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, Context context) { + return 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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource) { + return 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 service resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ServiceResourceInner> beginUpdate( + String resourceGroupName, String serviceName, ServiceResourceInner resource, Context context) { + return 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 listTestKeysAsync(resourceGroupName, serviceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 regenerateTestKeyAsync(resourceGroupName, serviceName, regenerateTestKeyRequest).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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((Response res) -> 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + disableTestEndpointAsync(resourceGroupName, serviceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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(); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 enableTestEndpointAsync(resourceGroupName, serviceName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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 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 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 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.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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String serviceName) { + return 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 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStop(String resourceGroupName, String serviceName, Context context) { + return 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 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 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 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 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 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 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 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.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 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.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 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String serviceName) { + return 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 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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart( + String resourceGroupName, String serviceName, Context context) { + return 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 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 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 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 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(); + } + + /** + * 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 checkNameAvailabilityAsync(location, availabilityParameters).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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(); + } + + /** + * 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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @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. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 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 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 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)); + } +} 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..0e998c68b731c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/ServicesImpl.java @@ -0,0 +1,304 @@ +// Copyright (c) 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.NameAvailabilityInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.appplatform.generated.fluent.models.TestKeysInner; +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.TestKeys; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ServicesImpl implements Services { + @JsonIgnore private 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 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 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 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 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 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 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 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 void disableTestEndpoint(String resourceGroupName, String serviceName) { + this.serviceClient().disableTestEndpoint(resourceGroupName, serviceName); + } + + public Response disableTestEndpointWithResponse( + String resourceGroupName, String serviceName, Context context) { + return this.serviceClient().disableTestEndpointWithResponse(resourceGroupName, serviceName, context); + } + + 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 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 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 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 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 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 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..56e7419f98ef9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusClientImpl.java @@ -0,0 +1,297 @@ +// Copyright (c) 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.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.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 { + private final ClientLogger logger = new ClientLogger(SkusClientImpl.class); + + /** 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") + private 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 Cloud 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 Cloud 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 Cloud SKU and a possible link for next set. + */ + @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 Cloud SKU and a possible link for next set. + */ + @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 Cloud SKU and a possible link for next set. + */ + @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 Cloud SKU and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of Azure Spring Cloud 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 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 Cloud 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..aba3b41e7525f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/SkusImpl.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.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SkusImpl implements Skus { + @JsonIgnore private 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..b9a2cdf9b059f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StorageResourceImpl.java @@ -0,0 +1,139 @@ +// Copyright (c) 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 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..ae625ac3892bc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesClientImpl.java @@ -0,0 +1,1147 @@ +// Copyright (c) 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.logging.ClientLogger; +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 { + private final ClientLogger logger = new ClientLogger(StoragesClientImpl.class); + + /** 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") + private 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( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 getAsync(resourceGroupName, serviceName, storageName).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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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(); + } + + /** + * 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 storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @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 storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageResourceInner> beginCreateOrUpdate( + String resourceGroupName, String serviceName, String storageName, StorageResourceInner storageResource) { + return 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 storage resource payload along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageResourceInner> beginCreateOrUpdate( + String resourceGroupName, + String serviceName, + String storageName, + StorageResourceInner storageResource, + Context context) { + return 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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String storageName) { + return 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String serviceName, String storageName, Context context) { + return 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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains 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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains the 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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains 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. + */ + @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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains the 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. + */ + @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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains 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. + */ + @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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains the 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. + */ + @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 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 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..65cfc07bd02cc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/implementation/StoragesImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class StoragesImpl implements Storages { + @JsonIgnore private 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 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 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 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/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/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..fdade677d3600 --- /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 Cloud. */ +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/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..81b24879f8be6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ActionType.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActionType. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** @return known ActionType values. */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/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..9c7f7bd001619 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ActiveDeploymentCollection.class); + + /* + * Collection of Deployment name. + */ + @JsonProperty(value = "activeDeploymentNames") + private List activeDeploymentNames; + + /** + * 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..cda1f8c788470 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of custom domain for API portal. */ +@Fluent +public final class ApiPortalCustomDomainProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalCustomDomainProperties.class); + + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * 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..e9066b89b61a1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomainResource.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..f05869d21eee4 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalCustomDomainResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalCustomDomainResourceCollection.class); + + /* + * 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; + + /** + * 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..02a3b90511c2c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalCustomDomains.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..0baca74373747 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the API portal. */ +@Immutable +public final class ApiPortalInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalInstance.class); + + /* + * 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; + + /** + * 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..3eab1337fb693 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API portal properties payload. */ +@Fluent +public final class ApiPortalProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalProperties.class); + + /* + * 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; + + /** + * 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..c9a8fedf576e4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ApiPortalProvisioningState. */ +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 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); + } + + /** @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..8b3288f4378d1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortalResource.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..c94268da9a529 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ApiPortalResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalResourceCollection.class); + + /* + * 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; + + /** + * 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..034f20313181e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource requests of the API portal. */ +@Immutable +public final class ApiPortalResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApiPortalResourceRequests.class); + + /* + * 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; + + /** + * 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..6f81151acc9d0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ApiPortals.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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/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..c52bc32bbc73d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResource.java @@ -0,0 +1,294 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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. + * + * @throws com.azure.core.management.exception.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(); + + /** + * 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); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); +} 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..9ce6fdf44a23b --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.AppResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceCollection.class); + + /* + * 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; + + /** + * 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..a875e4e84edaa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProperties.java @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppResourceProperties.class); + + /* + * 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") + 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; + + /** + * 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; + } + + /** + * Set the fqdn property: Fully qualified dns Name. + * + * @param fqdn the fqdn value to set. + * @return the AppResourceProperties object itself. + */ + public AppResourceProperties withFqdn(String fqdn) { + this.fqdn = fqdn; + return this; + } + + /** + * 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; + } + + /** + * 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()); + } + } +} 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..f08808ba78113 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AppResourceProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AppResourceProvisioningState. */ +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 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); + } + + /** @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/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..1a6219c46080e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Application Insights agent versions properties payload. */ +@Immutable +public final class ApplicationInsightsAgentVersions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ApplicationInsightsAgentVersions.class); + + /* + * Indicates the version of application insight java agent + */ + @JsonProperty(value = "java", access = JsonProperty.Access.WRITE_ONLY) + private String java; + + /** + * 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/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..24f5907cc5ae0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Apps.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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..02277259ed1fb --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.OperationDetailInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Available operations of the service. */ +@Fluent +public final class AvailableOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperations.class); + + /* + * 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; + + /** + * 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..a98a9edc62cca --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/AzureFileVolume.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileVolume.class); + + /* + * The share name of the Azure File share. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * 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 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(); + if (shareName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property shareName in model AzureFileVolume")); + } + } +} 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..3d6af429ee749 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResource.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.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 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..bef3a15b386c7 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BindingResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceCollection.class); + + /* + * 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; + + /** + * 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..5cd9eb21bdb74 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingResourceProperties.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BindingResourceProperties.class); + + /* + * 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; + + /** + * 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..fcad0a0ac00ad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BindingType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BindingType. */ +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"); + + /** + * 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); + } + + /** @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..d0fd2e1a33b27 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Bindings.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..140a691bae1b7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Build.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.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 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..c0c61c957248f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildCollection.class); + + /* + * 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; + + /** + * 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..aac0075b64fbb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProperties.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Build resource properties payload. */ +@Fluent +public final class BuildProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildProperties.class); + + /* + * 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 build result triggered by this build + */ + @JsonProperty(value = "triggeredBuildResult", access = JsonProperty.Access.WRITE_ONLY) + private TriggeredBuildResult triggeredBuildResult; + + /** + * 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 triggeredBuildResult property: The build result triggered by this build. + * + * @return the triggeredBuildResult value. + */ + public TriggeredBuildResult triggeredBuildResult() { + return this.triggeredBuildResult; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (triggeredBuildResult() != null) { + triggeredBuildResult().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..192e55bb6cbdc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BuildProvisioningState. */ +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 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); + } + + /** @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/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..bb25abc280ed6 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildResultInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildResultCollection.class); + + /* + * 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; + + /** + * 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..268a38f11fbd1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Build result resource properties payload. */ +@Fluent +public final class BuildResultProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildResultProperties.class); + + /* + * 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; + + /* + * 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; + + /** + * 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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..bbc253b68de9a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BuildResultProvisioningState. */ +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 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); + } + + /** @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..fa2e8165348fa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildResultUserSourceInfo.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildResultUserSourceInfo.class); + + /* + * Resource id of an existing succeeded build result under the same Spring + * instance. + */ + @JsonProperty(value = "buildResultId") + private String buildResultId; + + /** + * 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..7701055f6ea00 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildService.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.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 inner com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner object. + * + * @return the inner object. + */ + BuildServiceInner innerModel(); +} 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..07b106b0c41a1 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service agent pool properties. */ +@Fluent +public final class BuildServiceAgentPoolProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceAgentPoolProperties.class); + + /* + * 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; + + /** + * 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..3b7d630634970 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceAgentPoolResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceAgentPoolResourceCollection.class); + + /* + * 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; + + /** + * 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..aa1357cf8d08a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service agent pool size properties. */ +@Fluent +public final class BuildServiceAgentPoolSizeProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceAgentPoolSizeProperties.class); + + /* + * 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; + + /** + * 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..84ba771bfbd14 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceAgentPools.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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..00fc4186cfb02 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceBuilders.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String buildServiceName, Context context); + + /** + * 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..7e50dee95d1d9 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildServiceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceCollection.class); + + /* + * 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; + + /** + * 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..8a4fd3bcbf34d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Build service resource properties payload. */ +@Fluent +public final class BuildServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServiceProperties.class); + + /* + * The installed KPack version in this build service. + */ + @JsonProperty(value = "kPackVersion") + private String kPackVersion; + + /* + * Provisioning state of the KPack build result + */ + @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; + + /** + * Get the kPackVersion property: The installed KPack version in this build service. + * + * @return the kPackVersion value. + */ + public String kPackVersion() { + return this.kPackVersion; + } + + /** + * Set the kPackVersion property: The installed KPack version in this build service. + * + * @param kPackVersion the kPackVersion value to set. + * @return the BuildServiceProperties object itself. + */ + public BuildServiceProperties withKPackVersion(String kPackVersion) { + this.kPackVersion = kPackVersion; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the KPack build result. + * + * @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..70ad79677cc32 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The runtime resource configuration of this build service. */ +@Immutable +public final class BuildServicePropertiesResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildServicePropertiesResourceRequests.class); + + /* + * 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; + + /** + * 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..c5f9c09a548c7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServiceProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BuildServiceProvisioningState. */ +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 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); + } + + /** @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..60a11d7ee73aa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildServices.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the 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 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 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 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 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 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 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 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 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 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 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 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 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 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); + + /** + * Begins definition for a new Build resource. + * + * @param name resource name. + * @return the first stage of the new Build definition. + */ + Build.DefinitionStages.Blank define(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..6d92a8f68e584 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildStageProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The build stage (init-container and container) resources in build pod. */ +@Immutable +public final class BuildStageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildStageProperties.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..96aef8673bbb2 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** KPack Builder properties payload. */ +@Fluent +public final class BuilderProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuilderProperties.class); + + /* + * 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; + + /** + * 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..d3a096a9daaaa --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BuilderProvisioningState. */ +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 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); + } + + /** @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..6d400a9763d2c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuilderResource.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.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 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); +} 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..49ab54aad1a67 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuilderResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuilderResourceCollection.class); + + /* + * 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; + + /** + * 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..42dcbeca49c78 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildpackBindingLaunchProperties.class); + + /* + * 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; + + /** + * 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..c7630e3b2c2a5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a buildpack binding. */ +@Fluent +public final class BuildpackBindingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildpackBindingProperties.class); + + /* + * 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; + + /** + * 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..c649906377aea --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BuildpackBindingProvisioningState. */ +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 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); + } + + /** @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..2c66cb48092d0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindingResource.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.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 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..408d17386d52c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.BuildpackBindingResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildpackBindingResourceCollection.class); + + /* + * 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; + + /** + * 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..00729323e2b16 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/BuildpackBindings.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.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 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..0caa6cea079d9 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Buildpack properties payload. */ +@Fluent +public final class BuildpackProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildpackProperties.class); + + /* + * Id of the buildpack + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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..760447108dd95 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Buildpack group properties of the Builder. */ +@Fluent +public final class BuildpacksGroupProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BuildpacksGroupProperties.class); + + /* + * Buildpack group name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Buildpacks in the buildpack group + */ + @JsonProperty(value = "buildpacks") + private List buildpacks; + + /** + * 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..64d596fe8cced --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateProperties.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.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateProperties.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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/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..4ec88c4b6f4fb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CertificateResource.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.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 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..0029d6f20151c --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CertificateResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CertificateResourceCollection.class); + + /* + * The certificate resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of certificate list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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/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..97ed7cffde921 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Certificates.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..f9858119961a0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ClusterResourceProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Service properties payload. */ +@Fluent +public final class ClusterResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ClusterResourceProperties.class); + + /* + * 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; + + /* + * Version of the Service + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private Integer version; + + /* + * ServiceInstanceEntity GUID which uniquely identifies a created resource + */ + @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) + private String serviceId; + + /* + * 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; + + /** + * 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 version property: Version of the Service. + * + * @return the version value. + */ + public Integer version() { + return this.version; + } + + /** + * Get the serviceId property: ServiceInstanceEntity GUID which uniquely identifies a created resource. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkProfile() != null) { + networkProfile().validate(); + } + } +} 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..e229b364ad852 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerGitProperty.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Property of git. */ +@Fluent +public final class ConfigServerGitProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerGitProperty.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..454b1dc145b15 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerProperties.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Config server git properties payload. */ +@Fluent +public final class ConfigServerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerProperties.class); + + /* + * 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; + + /* + * Settings of config server. + */ + @JsonProperty(value = "configServer") + private ConfigServerSettings configServer; + + /** + * 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 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..48a949167ca16 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerResource.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.models; + +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 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..107dc066c02ff --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The settings of config server. */ +@Fluent +public final class ConfigServerSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerSettings.class); + + /* + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigServerGitProperty gitProperty; + + /** + * 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..12ef8743b6e2c --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Error record of the config server settings. */ +@Fluent +public final class ConfigServerSettingsErrorRecord { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigServerSettingsErrorRecord.class); + + /* + * 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; + + /** + * 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..75beda03ea651 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigServerState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConfigServerState. */ +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 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); + } + + /** @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..2e36009e3b3cf --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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/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..22893f23a86b7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Property of git environment. */ +@Fluent +public final class ConfigurationServiceGitProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceGitProperty.class); + + /* + * Repositories of Application Configuration Service git property. + */ + @JsonProperty(value = "repositories") + private List repositories; + + /** + * 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..bb859f3eecb06 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitPropertyValidateResult.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validation result for configuration service settings. */ +@Fluent +public final class ConfigurationServiceGitPropertyValidateResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ConfigurationServiceGitPropertyValidateResult.class); + + /* + * Indicate if the configuration service settings are valid + */ + @JsonProperty(value = "isValid") + private Boolean isValid; + + /* + * The detail validation results + */ + @JsonProperty(value = "gitReposValidationResult") + private List gitReposValidationResult; + + /** + * 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..c34ae094bc05a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceGitRepository.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Git repository property payload for Application Configuration Service. */ +@Fluent +public final class ConfigurationServiceGitRepository { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceGitRepository.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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")); + } + } +} 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..37562087bdf28 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Application Configuration Service. */ +@Immutable +public final class ConfigurationServiceInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceInstance.class); + + /* + * 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; + + /** + * 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..300a7f00f8c8f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProperties.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Application Configuration Service properties payload. */ +@Fluent +public final class ConfigurationServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceProperties.class); + + /* + * State of the Application Configuration Service. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ConfigurationServiceProvisioningState provisioningState; + + /* + * 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; + + /** + * Get the provisioningState property: State of the Application Configuration Service. + * + * @return the provisioningState value. + */ + public ConfigurationServiceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * 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..e86e41739653a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceProvisioningState.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; + +/** Defines values for ConfigurationServiceProvisioningState. */ +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 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); + } + + /** @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..53e7ead656f26 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServiceResource.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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); +} 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..3364c5c63bd12 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigurationServiceResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceResourceCollection.class); + + /* + * 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; + + /** + * 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..bf514f289c058 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Application Configuration Service. */ +@Immutable +public final class ConfigurationServiceResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceResourceRequests.class); + + /* + * 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; + + /** + * 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..5dc7da43b9c26 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The settings of Application Configuration Service. */ +@Fluent +public final class ConfigurationServiceSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfigurationServiceSettings.class); + + /* + * Property of git environment. + */ + @JsonProperty(value = "gitProperty") + private ConfigurationServiceGitProperty gitProperty; + + /** + * 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..c7b16232fcef9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ConfigurationServices.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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); + + /** + * 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..49838b2535417 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container liveness and readiness probe settings. */ +@Fluent +public final class ContainerProbeSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerProbeSettings.class); + + /* + * Indicates whether disable the liveness and readiness probe + */ + @JsonProperty(value = "disableProbe") + private Boolean disableProbe; + + /** + * 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/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..70bb327bb4fcc --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContentCertificateProperties.class); + + /* + * The content of uploaded certificate. + */ + @JsonProperty(value = "content") + private String content; + + /** + * 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..6406d4a79deb7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomContainer.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Custom container payload. */ +@Fluent +public final class CustomContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomContainer.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..adfb77648ee25 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomContainerUserSourceInfo.class); + + /* + * Custom container payload + */ + @JsonProperty(value = "customContainer") + private CustomContainer customContainer; + + /** + * 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..73f90d3c48449 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain of app resource payload. */ +@Fluent +public final class CustomDomainProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainProperties.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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..fb912345a022a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainResource.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.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 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..2ed003e1896be --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.CustomDomainResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainResourceCollection.class); + + /* + * 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; + + /** + * 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/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..64107c7e1a3cf --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomainValidatePayload.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom domain validate payload. */ +@Fluent +public final class CustomDomainValidatePayload { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomDomainValidatePayload.class); + + /* + * Name to be validated + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * 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")); + } + } +} 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..094b076f6465f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomDomains.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..9ee9a97f82560 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskProperties.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appplatform.generated.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomPersistentDiskProperties.class); + + /* + * 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; + + /* + * These are the mount options for a persistent disk. + */ + @JsonProperty(value = "mountOptions") + private List mountOptions; + + /** + * 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 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")); + } + } +} 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..86da45438e0ad --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/CustomPersistentDiskResource.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom persistent disk resource payload. */ +@Fluent +public final class CustomPersistentDiskResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomPersistentDiskResource.class); + + /* + * Properties of the custom persistent disk resource payload. + */ + @JsonProperty(value = "customPersistentDiskProperties") + private CustomPersistentDiskProperties customPersistentDiskProperties; + + /* + * The resource id of Azure Spring Cloud Storage resource. + */ + @JsonProperty(value = "storageId", required = true) + private String storageId; + + /** + * 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 Cloud Storage resource. + * + * @return the storageId value. + */ + public String storageId() { + return this.storageId; + } + + /** + * Set the storageId property: The resource id of Azure Spring Cloud 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")); + } + } +} 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..8a21be440fff5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment instance payload. */ +@Immutable +public final class DeploymentInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentInstance.class); + + /* + * 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; + + /** + * 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/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..2501b6045b9f6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResource.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.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 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); + + /** + * 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(); + + /** + * 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); + + /** + * 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..cbf787cd78ed5 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.DeploymentResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceCollection.class); + + /* + * 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; + + /** + * 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..84c11fb7ce591 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Deployment resource properties payload. */ +@Fluent +public final class DeploymentResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentResourceProperties.class); + + /* + * 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; + + /** + * 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..a352ec634b255 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentResourceProvisioningState. */ +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 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); + } + + /** @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..95f07377691c1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentResourceStatus.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DeploymentResourceStatus. */ +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 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); + } + + /** @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..48b6a84fa57f0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/DeploymentSettings.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Deployment settings payload. */ +@Fluent +public final class DeploymentSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DeploymentSettings.class); + + /* + * 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 addons + */ + @JsonProperty(value = "addonConfigs") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> addonConfigs; + + /* + * Container liveness and readiness probe settings + */ + @JsonProperty(value = "containerProbeSettings") + private ContainerProbeSettings containerProbeSettings; + + /** + * 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 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 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 (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..8f53e23f6e8b7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Deployments.java @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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. + */ + PagedIterable list( + String resourceGroupName, String serviceName, String appName, List version, 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. + */ + 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is 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. + */ + PagedIterable listForCluster( + String resourceGroupName, String serviceName, List version, 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); + + /** + * 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); + + /** + * 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); + + /** + * 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/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..3b97451836c91 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Diagnostic parameters of diagnostic operations. */ +@Fluent +public final class DiagnosticParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DiagnosticParameters.class); + + /* + * 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; + + /** + * 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..175e505d775b3 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The error code compose of code and message. */ +@Fluent +public final class Error { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Error.class); + + /* + * The code of error. + */ + @JsonProperty(value = "code") + private String code; + + /* + * The message of error. + */ + @JsonProperty(value = "message") + private String message; + + /** + * 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/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..90f566b369c72 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiMetadataProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** API metadata property for Spring Cloud Gateway. */ +@Fluent +public final class GatewayApiMetadataProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayApiMetadataProperties.class); + + /* + * 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; + + /** + * 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..c56b8f1f72223 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayApiRoute.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API route config of the Spring Cloud Gateway. */ +@Fluent +public final class GatewayApiRoute { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayApiRoute.class); + + /* + * 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; + + /** + * 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/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..d930bbdd01f0e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCorsProperties.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cross-Origin Resource Sharing property. */ +@Fluent +public final class GatewayCorsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCorsProperties.class); + + /* + * Allowed origins to make cross-site requests. The special value `*` + * allows all domains. + */ + @JsonProperty(value = "allowedOrigins") + private List allowedOrigins; + + /* + * 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; + + /** + * 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 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..106d10d67b533 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of custom domain for Spring Cloud Gateway. */ +@Fluent +public final class GatewayCustomDomainProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCustomDomainProperties.class); + + /* + * The thumbprint of bound certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * 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..29b4365a7eba3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayCustomDomainResource.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..6e6bfe29a0338 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayCustomDomainResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayCustomDomainResourceCollection.class); + + /* + * 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; + + /** + * 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..c7cd1c3e6a468 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..aa5ca9b0acdbe --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Spring Cloud Gateway. */ +@Immutable +public final class GatewayInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayInstance.class); + + /* + * 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; + + /** + * 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..dd7897e9f77ee --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the Spring Cloud Gateway Operator. */ +@Immutable +public final class GatewayOperatorProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayOperatorProperties.class); + + /* + * 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; + + /** + * 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..126b9ca8cb11a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the Spring Cloud Gateway Operator. */ +@Immutable +public final class GatewayOperatorResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayOperatorResourceRequests.class); + + /* + * 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; + + /** + * 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..87ef827ad56a6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProperties.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Spring Cloud Gateway properties payload. */ +@Fluent +public final class GatewayProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayProperties.class); + + /* + * 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; + + /* + * The requested resource quantity for required CPU and Memory. + */ + @JsonProperty(value = "resourceRequests") + private GatewayResourceRequests resourceRequests; + + /* + * 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; + + /** + * 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 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 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 (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/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..c8444c8126ca0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GatewayProvisioningState. */ +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 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); + } + + /** @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..0bc91281b114e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayResource.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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; + +/** 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 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.WithProperties, 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 properties. */ + interface WithProperties { + /** + * Specifies the properties property: Spring Cloud Gateway properties payload. + * + * @param properties Spring Cloud Gateway properties payload. + * @return the next definition stage. + */ + Update withProperties(GatewayProperties properties); + } + /** 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); + + /** + * 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); + + /** + * 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); +} 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..e4cd89d92de22 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayResourceCollection.class); + + /* + * 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; + + /** + * 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..8aa80e39200dc --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Spring Cloud Gateway. */ +@Fluent +public final class GatewayResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayResourceRequests.class); + + /* + * 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; + + /** + * 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/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..40d0ac23bcac5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** API route config of the Spring Cloud Gateway. */ +@Fluent +public final class GatewayRouteConfigProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRouteConfigProperties.class); + + /* + * 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 Cloud app, required unless route + * defines `uri`. + */ + @JsonProperty(value = "appResourceId") + private String appResourceId; + + /* + * Array of API routes, each route contains properties such as `title`, + * `uri`, `ssoEnabled`, `predicates`, `filters`. + */ + @JsonProperty(value = "routes") + private List routes; + + /** + * 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 Cloud 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 Cloud 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 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void 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/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..2cb8c4931b2a8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GatewayRouteConfigResource.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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 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..b7bb07cde95b0 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.GatewayRouteConfigResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GatewayRouteConfigResourceCollection.class); + + /* + * 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; + + /** + * 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..6bf88ad7fb91b --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..4db52a5748cf3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Gateways.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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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/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..1e244bb103f53 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/GitPatternRepository.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Git repository property payload for config server. */ +@Fluent +public final class GitPatternRepository { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GitPatternRepository.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..8b3f39d17647a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Credential of the image registry. */ +@Fluent +public final class ImageRegistryCredential { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ImageRegistryCredential.class); + + /* + * 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; + + /** + * 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/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..69a8d6ec150d1 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(JarUploadedUserSourceInfo.class); + + /* + * Runtime version of the Jar file + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /* + * JVM parameter + */ + @JsonProperty(value = "jvmOptions") + private String jvmOptions; + + /** + * 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..e7dbffb8f9d7d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KPackBuildStageProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KPackBuildStageProvisioningState. */ +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 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); + } + + /** @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/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..f5dbba1142670 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/KeyVaultCertificateProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultCertificateProperties.class); + + /* + * 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; + + /** + * 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; + } + + /** + * 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")); + } + } +} 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..3cafd2af0f709 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/LoadedCertificate.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.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Loaded certificate payload. */ +@Fluent +public final class LoadedCertificate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LoadedCertificate.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..d834a7c6bfa4f --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Log for Azure Monitoring. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * 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; + + /** + * 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/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..f3171a02de8e8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityProperties.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed identity properties retrieved from ARM request headers. */ +@Fluent +public final class ManagedIdentityProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentityProperties.class); + + /* + * Type of the managed identity + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * Principal Id + */ + @JsonProperty(value = "principalId") + private String principalId; + + /* + * Tenant Id + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * 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. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: Principal Id. + * + * @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. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id. + * + * @param tenantId the tenantId value to set. + * @return the ManagedIdentityProperties object itself. + */ + public ManagedIdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + 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/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..8bad71645df36 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ManagedIdentityType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentityType. */ +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 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); + } + + /** @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/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..5d16a45e07855 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricDimension.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Dimension of metrics. */ +@Fluent +public final class MetricDimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricDimension.class); + + /* + * 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; + + /** + * 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..6d12ff72c8571 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MetricSpecification.java @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifications of the Metrics for Azure Monitoring. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * 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; + + /** + * 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..6927640f1a510 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingProperties.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Monitoring Setting properties payload. */ +@Fluent +public final class MonitoringSettingProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MonitoringSettingProperties.class); + + /* + * 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; + + /** + * 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..36ccc6ad697a0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/MonitoringSettingState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for MonitoringSettingState. */ +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 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); + } + + /** @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..9d929636f8e10 --- /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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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..6a99d70c707ce --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NameAvailabilityParameters.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Name availability parameters payload. */ +@Fluent +public final class NameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityParameters.class); + + /* + * 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; + + /** + * 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")); + } + } +} 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..6da02809ea390 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetCoreZipUploadedUserSourceInfo.class); + + /* + * 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; + + /** + * 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..38d622d2d90c3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/NetworkProfile.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service network profile payload. */ +@Fluent +public final class NetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfile.class); + + /* + * Fully qualified resource Id of the subnet to host Azure Spring Cloud + * Service Runtime + */ + @JsonProperty(value = "serviceRuntimeSubnetId") + private String serviceRuntimeSubnetId; + + /* + * Fully qualified resource Id of the subnet to host Azure Spring Cloud + * Apps + */ + @JsonProperty(value = "appSubnetId") + private String appSubnetId; + + /* + * Azure Spring Cloud service reserved CIDR + */ + @JsonProperty(value = "serviceCidr") + private String serviceCidr; + + /* + * Name of the resource group containing network resources of Azure Spring + * Cloud Service Runtime + */ + @JsonProperty(value = "serviceRuntimeNetworkResourceGroup") + private String serviceRuntimeNetworkResourceGroup; + + /* + * Name of the resource group containing network resources of Azure Spring + * Cloud Apps + */ + @JsonProperty(value = "appNetworkResourceGroup") + private String appNetworkResourceGroup; + + /* + * Desired outbound IP resources for Azure Spring Cloud instance. + */ + @JsonProperty(value = "outboundIPs", access = JsonProperty.Access.WRITE_ONLY) + private NetworkProfileOutboundIPs outboundIPs; + + /* + * Required inbound or outbound traffics for Azure Spring Cloud instance. + */ + @JsonProperty(value = "requiredTraffics", access = JsonProperty.Access.WRITE_ONLY) + private List requiredTraffics; + + /** + * Get the serviceRuntimeSubnetId property: Fully qualified resource Id of the subnet to host Azure Spring Cloud + * 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 Cloud + * 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 Azure Spring Cloud Apps. + * + * @return the appSubnetId value. + */ + public String appSubnetId() { + return this.appSubnetId; + } + + /** + * Set the appSubnetId property: Fully qualified resource Id of the subnet to host Azure Spring Cloud 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 Cloud service reserved CIDR. + * + * @return the serviceCidr value. + */ + public String serviceCidr() { + return this.serviceCidr; + } + + /** + * Set the serviceCidr property: Azure Spring Cloud 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 Cloud 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 Cloud 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 of Azure Spring + * Cloud Apps. + * + * @return the appNetworkResourceGroup value. + */ + public String appNetworkResourceGroup() { + return this.appNetworkResourceGroup; + } + + /** + * Set the appNetworkResourceGroup property: Name of the resource group containing network resources of Azure Spring + * Cloud 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 Cloud instance. + * + * @return the outboundIPs value. + */ + public NetworkProfileOutboundIPs outboundIPs() { + return this.outboundIPs; + } + + /** + * Get the requiredTraffics property: Required inbound or outbound traffics for Azure Spring Cloud instance. + * + * @return the requiredTraffics value. + */ + public List requiredTraffics() { + return this.requiredTraffics; + } + + /** + * 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()); + } + } +} 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..c721a51e71ea0 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Desired outbound IP resources for Azure Spring Cloud instance. */ +@Immutable +public final class NetworkProfileOutboundIPs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkProfileOutboundIPs.class); + + /* + * A list of public IP addresses. + */ + @JsonProperty(value = "publicIPs", access = JsonProperty.Access.WRITE_ONLY) + private List publicIPs; + + /** + * 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..d08d7e473faeb --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * 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; + + /** + * 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..7004fb9a2533a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extra Operation properties. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * Service specifications of the operation + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * 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..e6034f53f639d --- /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. + */ + 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. + */ + 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..4a916afcda2c7 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Persistent disk payload. */ +@Fluent +public final class PersistentDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PersistentDisk.class); + + /* + * 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; + + /** + * 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..47d0e70ef6cc7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/PowerState.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PowerState. */ +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 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); + } + + /** @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/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..1a9122395ef81 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ProvisioningState.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +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 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 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); + } + + /** @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/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..e608dd92afa4b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/RegenerateTestKeyRequestPayload.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Regenerate test key request payload. */ +@Fluent +public final class RegenerateTestKeyRequestPayload { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateTestKeyRequestPayload.class); + + /* + * Type of the test key + */ + @JsonProperty(value = "keyType", required = true) + private TestKeyType keyType; + + /** + * 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")); + } + } +} 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..c4320e3ba4378 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Required inbound or outbound traffic for Azure Spring Cloud instance. */ +@Immutable +public final class RequiredTraffic { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RequiredTraffic.class); + + /* + * 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; + + /** + * 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..c472200d1cd20 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceRequests.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Deployment resource request payload. */ +@Fluent +public final class ResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceRequests.class); + + /* + * 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; + + /** + * 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..5d8f6498f4fb4 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The ResourceSkuCapabilities model. */ +@Fluent +public final class ResourceSkuCapabilities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCapabilities.class); + + /* + * 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; + + /** + * 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..e64e9f1a3ff9f --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ResourceSkuInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of Azure Spring Cloud SKU and a possible link for next set. */ +@Fluent +public final class ResourceSkuCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuCollection.class); + + /* + * 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; + + /** + * 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..d84ac0bf9ba5b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Locations and availability zones where the SKU is available. */ +@Fluent +public final class ResourceSkuLocationInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuLocationInfo.class); + + /* + * 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; + + /** + * 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..9bb9b9e91ed89 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictionInfo.class); + + /* + * 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; + + /** + * 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..f864cfb622915 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictions.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Restrictions where the SKU cannot be used. */ +@Fluent +public final class ResourceSkuRestrictions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuRestrictions.class); + + /* + * 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; + + /** + * 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..44cc89b826dac --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsReasonCode.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsReasonCode. */ +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 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); + } + + /** @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..4e0935c328a41 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ResourceSkuRestrictionsType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ResourceSkuRestrictionsType. */ +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 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); + } + + /** @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..1c605fdcefe72 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSkuZoneDetails.class); + + /* + * 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; + + /** + * 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..480f80db6908b --- /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. + * + * @throws com.azure.core.management.exception.ManagementException 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(); + + /** + * 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); +} 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..8850906ef7332 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistries.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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..18d897b1fcb0a --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Collection of instances belong to the Service Registry. */ +@Immutable +public final class ServiceRegistryInstance { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRegistryInstance.class); + + /* + * 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; + + /** + * 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..e0dc118fa5598 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service Registry properties payload. */ +@Immutable +public final class ServiceRegistryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRegistryProperties.class); + + /* + * 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; + + /** + * 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..91166d40d24f1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceRegistryProvisioningState.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceRegistryProvisioningState. */ +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 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); + } + + /** @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..20843ca5255b1 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceRegistryResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRegistryResourceCollection.class); + + /* + * 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; + + /** + * 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..a5a3d764f0607 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Resource request payload of Service Registry. */ +@Immutable +public final class ServiceRegistryResourceRequests { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceRegistryResourceRequests.class); + + /* + * 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; + + /** + * 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..0a6eca77a550b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/ServiceResource.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.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 region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.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. + * + * @throws com.azure.core.management.exception.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(); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * 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(); + + /** + * 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); + + /** + * Stop 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 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 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 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(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..789135d018650 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ServiceResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceResourceList.class); + + /* + * 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; + + /** + * 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..8000408526427 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification payload. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * 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; + + /** + * 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/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..aa4fdc0f74f7a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Services.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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); + + /** + * 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 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 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 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String serviceName, 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); + + /** + * 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); + + /** + * 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. + */ + 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. + */ + 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. + */ + 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. + */ + PagedIterable listByResourceGroup(String resourceGroupName, 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/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..c43190931269e --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sku of Azure Spring Cloud. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * 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; + + /** + * 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..279aad707fb54 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SKU capacity. */ +@Fluent +public final class SkuCapacity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuCapacity.class); + + /* + * 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; + + /** + * 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/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..a7cb958e8290f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SkuScaleType.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SkuScaleType. */ +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 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); + } + + /** @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..dfd890ff1797b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Skus.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 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 Cloud SKU and a possible link for next set. + */ + 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 Cloud SKU and a possible link for next set. + */ + 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..8f5769c087f38 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SourceUploadedUserSourceInfo.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceUploadedUserSourceInfo.class); + + /* + * 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; + + /** + * 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..9ad5125b35957 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SsoProperties.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.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Single sign-on related configuration. */ +@Fluent +public final class SsoProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsoProperties.class); + + /* + * 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; + + /** + * 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..15642e80b214b --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** KPack ClusterStack properties payload. */ +@Fluent +public final class StackProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StackProperties.class); + + /* + * Id of the ClusterStack. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Version of the ClusterStack + */ + @JsonProperty(value = "version") + private String version; + + /** + * 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..e1d7175824c2a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageAccount.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageAccount.class); + + /* + * 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", required = true) + private String accountKey; + + /** + * 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")); + } + } +} 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..6cd55eeb70759 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageProperties.class); + + /** + * 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..f437434a0b66f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/StorageResource.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.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 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..1977251f853c3 --- /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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appplatform.generated.fluent.models.StorageResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StorageResourceCollection.class); + + /* + * The storage resources list. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to next page of storage list. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * 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/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..00495faf4f16b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/Storages.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.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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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); + + /** + * 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); + + /** + * 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 Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains 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. + */ + PagedIterable list(String resourceGroupName, String serviceName); + + /** + * List all the storages of one Azure Spring Cloud instance. + * + * @param resourceGroupName The name of the resource group that contains the 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. + */ + 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/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..c63d4f861a779 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported buildpack resource properties. */ +@Fluent +public final class SupportedBuildpackResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedBuildpackResourceProperties.class); + + /* + * The id of supported buildpack + */ + @JsonProperty(value = "buildpackId") + private String buildpackId; + + /** + * 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..6e19e03db251c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimePlatform.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SupportedRuntimePlatform. */ +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 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); + } + + /** @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..0da3c0224281b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeValue.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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SupportedRuntimeValue. */ +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 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); + } + + /** @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..74ca2c9f4f877 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/SupportedRuntimeVersion.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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported deployment runtime version descriptor. */ +@Fluent +public final class SupportedRuntimeVersion { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedRuntimeVersion.class); + + /* + * 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; + + /** + * 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/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..9ccb421ee0e10 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Supported stack resource properties. */ +@Fluent +public final class SupportedStackResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportedStackResourceProperties.class); + + /* + * The id of supported stack + */ + @JsonProperty(value = "stackId") + private String stackId; + + /* + * The version of supported stack + */ + @JsonProperty(value = "version") + private String version; + + /** + * 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/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..43f3d63077d45 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Temporary disk payload. */ +@Fluent +public final class TemporaryDisk { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TemporaryDisk.class); + + /* + * 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; + + /** + * 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..f52df90888233 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TestKeyType.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TestKeyType. */ +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 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); + } + + /** @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..52deb6e0932a7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/TrafficDirection.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.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TrafficDirection. */ +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 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); + } + + /** @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..e1138d176caca --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The build result triggered by a build. */ +@Fluent +public final class TriggeredBuildResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TriggeredBuildResult.class); + + /* + * The unique build id of this build result + */ + @JsonProperty(value = "id") + private String id; + + /** + * 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/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..5b8d05599a3dc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/main/java/com/azure/resourcemanager/appplatform/generated/models/UploadedUserSourceInfo.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.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 = "Source", value = SourceUploadedUserSourceInfo.class), + @JsonSubTypes.Type(name = "NetCoreZip", value = NetCoreZipUploadedUserSourceInfo.class) +}) +@Fluent +public class UploadedUserSourceInfo extends UserSourceInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UploadedUserSourceInfo.class); + + /* + * Relative path of the storage which stores the source + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * 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/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..8acd9098e36e6 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserSourceInfo.class); + + /* + * Version of the source + */ + @JsonProperty(value = "version") + private String version; + + /** + * 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..8efd8bcefbcc5 --- /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.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Validate messages of the configuration service git repositories. */ +@Fluent +public final class ValidationMessages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ValidationMessages.class); + + /* + * The name of the configuration service git repository. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Detailed validation messages. + */ + @JsonProperty(value = "messages") + private List messages; + + /** + * 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/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..2e23b7e915bc6 --- /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 Cloud. */ +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..8f0caa4f6e2b5 --- /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 Cloud. */ +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..19525e3950def --- /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/2022-01-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..7547e478159e5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ApiPortalCustomDomains Delete. */ +public final class ApiPortalCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..46448c91149dc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalCustomDomainsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for ApiPortalCustomDomains Get. */ +public final class ApiPortalCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..aa97b6325d8b9 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ApiPortalCustomDomains List. */ +public final class ApiPortalCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..c46c4e3d6b57f --- /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/2022-01-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..e20ad2d1ae603 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApiPortals Delete. */ +public final class ApiPortalsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..0f6d3de189999 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ApiPortals Get. */ +public final class ApiPortalsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..e33636f5bac7b --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ApiPortals List. */ +public final class ApiPortalsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..9026eca2b1d61 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ApiPortalsValidateDomainSamples.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.core.util.Context; +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/2022-01-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"), + 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..7a7536406be6c --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +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.PersistentDisk; +import com.azure.resourcemanager.appplatform.generated.models.TemporaryDisk; +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/2022-01-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"))) + .withFqdn("myapp.mydomain.com") + .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)))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..f3a34239c4984 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Apps Delete. */ +public final class AppsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..814e213a5e5b4 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetResourceUploadUrlSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Apps GetResourceUploadUrl. */ +public final class AppsGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..750d3ff22ee4d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Apps Get. */ +public final class AppsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, 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..7153894e74a37 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Apps List. */ +public final class AppsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..0c0e236693e34 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsSetActiveDeploymentsSamples.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.core.util.Context; +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/2022-01-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")), + 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..8dca111811eb2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.models.AppResource; +import com.azure.resourcemanager.appplatform.generated.models.AppResourceProperties; +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 java.util.Arrays; + +/** Samples for Apps Update. */ +public final class AppsUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, Context.NONE).getValue(); + resource + .update() + .withProperties( + new AppResourceProperties() + .withPublicProperty(true) + .withFqdn("myapp.mydomain.com") + .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)) + .apply(); + } +} 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..e2f990b8d40cd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/AppsValidateDomainSamples.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.core.util.Context; +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/2022-01-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"), + 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..f0d3f688394d3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsCreateOrUpdateSamples.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.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/2022-01-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("xxxx") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..cb275cbf588f0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Bindings Delete. */ +public final class BindingsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..240a4d267b91a --- /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; + +import com.azure.core.util.Context; + +/** Samples for Bindings Get. */ +public final class BindingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..fb1444b50bc90 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BindingsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Bindings List. */ +public final class BindingsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6e8212a35ed5d --- /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.core.util.Context; +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/2022-01-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", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new BindingResourceProperties() + .withKey("xxxx") + .withBindingParameters(mapOf("apiType", "SQL", "databaseName", "db1"))) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..1ffaff6f26777 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildServiceAgentPool Get. */ +public final class BuildServiceAgentPoolGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..03fb5e9f215ad --- /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; + +import com.azure.core.util.Context; + +/** Samples for BuildServiceAgentPool List. */ +public final class BuildServiceAgentPoolListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..2ef68c8c79a60 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceAgentPoolUpdatePutSamples.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.core.util.Context; +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/2022-01-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"))), + 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..cc62b0c7a55e1 --- /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/2022-01-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..829dfb018dab2 --- /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; + +import com.azure.core.util.Context; + +/** Samples for BuildServiceBuilder Delete. */ +public final class BuildServiceBuilderDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6af1c0e3c3532 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceBuilderGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildServiceBuilder Get. */ +public final class BuildServiceBuilderGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..f498efd782c35 --- /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; + +import com.azure.core.util.Context; + +/** Samples for BuildServiceBuilder List. */ +public final class BuildServiceBuilderListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6a5449a35f4f3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceCreateOrUpdateBuildSamples.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.models.BuildProperties; +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/2022-01-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() + .define("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"))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..73205902dc269 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultLogSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuildResultLog. */ +public final class BuildServiceGetBuildResultLogSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..342b3ac752293 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildResultSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuildResult. */ +public final class BuildServiceGetBuildResultSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..30c20f02218c0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetBuildSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuild. */ +public final class BuildServiceGetBuildSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..2f052a7e1c685 --- /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; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetBuildService. */ +public final class BuildServiceGetBuildServiceSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..8f5646a0018e7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetResourceUploadUrlSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetResourceUploadUrl. */ +public final class BuildServiceGetResourceUploadUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..a55d2280e589f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedBuildpackSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetSupportedBuildpack. */ +public final class BuildServiceGetSupportedBuildpackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..5a984cea65b8d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceGetSupportedStackSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService GetSupportedStack. */ +public final class BuildServiceGetSupportedStackSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..98561dca3b61f --- /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; + +import com.azure.core.util.Context; + +/** Samples for BuildService ListBuildResults. */ +public final class BuildServiceListBuildResultsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..e82d60bf5b08e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildServicesSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BuildService ListBuildServices. */ +public final class BuildServiceListBuildServicesSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..2e78f47b925e5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListBuildsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BuildService ListBuilds. */ +public final class BuildServiceListBuildsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..ea60c5bc30aec --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedBuildpacksSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService ListSupportedBuildpacks. */ +public final class BuildServiceListSupportedBuildpacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..260e017106b61 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildServiceListSupportedStacksSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildService ListSupportedStacks. */ +public final class BuildServiceListSupportedStacksSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..8d7c36cc87b16 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingCreateOrUpdateSamples.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.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/2022-01-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(); + } + + @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..918c5fa11ae56 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingDeleteSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for BuildpackBinding Delete. */ +public final class BuildpackBindingDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..c76859c14b6f2 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/BuildpackBindingGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for BuildpackBinding Get. */ +public final class BuildpackBindingGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..f4243ce397595 --- /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; + +import com.azure.core.util.Context; + +/** Samples for BuildpackBinding List. */ +public final class BuildpackBindingListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..599fa4d3d38b6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesCreateOrUpdateSamples.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.models.KeyVaultCertificateProperties; + +/** Samples for Certificates CreateOrUpdate. */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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("mycert") + .withCertVersion("08a219d06d874795a96db47e06fbb01e")) + .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..59c53f4229ea0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..23fcaecc7c61b --- /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; + +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..75c8f1a456ff9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CertificatesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Certificates List. */ +public final class CertificatesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..1988ef61a5189 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConfigServers Get. */ +public final class ConfigServersGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..4032e7fd8b066 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePatchSamples.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.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +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/2022-01-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("/"))))), + 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..d1bb4aad9fd8e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersUpdatePutSamples.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.core.util.Context; +import com.azure.resourcemanager.appplatform.generated.fluent.models.ConfigServerResourceInner; +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/2022-01-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("/"))))), + 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..b12845ebc87b9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigServersValidateSamples.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.core.util.Context; +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/2022-01-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("/"))), + 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..c9452732cce56 --- /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/2022-01-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..c07c620360111 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ConfigurationServices Delete. */ +public final class ConfigurationServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..224515fed86f0 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ConfigurationServices Get. */ +public final class ConfigurationServicesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..d6df8c125091d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ConfigurationServices List. */ +public final class ConfigurationServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..1395286beacae --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ConfigurationServicesValidateSamples.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.generated; + +import com.azure.core.util.Context; +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/2022-01-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")))), + 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..2c4df60703f1f --- /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/2022-01-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..95dd53ba3c566 --- /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; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains Delete. */ +public final class CustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..281bef53bccbc --- /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; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains Get. */ +public final class CustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..a2d6ee3f41d9a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/CustomDomainsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for CustomDomains List. */ +public final class CustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..0e584ebbf4cf3 --- /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.core.util.Context; +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/2022-01-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", 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/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..ce442f8e57583 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsCreateOrUpdateSamples.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.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +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.ImageRegistryCredential; +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/2022-01-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")) + .withAddonConfigs( + mapOf( + "ApplicationConfigurationService", + mapOf( + "patterns", + SerializerFactory + .createDefaultManagementSerializerAdapter() + .deserialize("[\"mypattern\"]", Object.class, SerializerEncoding.JSON)))))) + .withSku(new Sku().withName("S0").withTier("Standard").withCapacity(1)) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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("myPassword")))) + .withDeploymentSettings( + new DeploymentSettings() + .withResourceRequests(new ResourceRequests().withCpu("1000m").withMemory("3Gi")) + .withEnvironmentVariables(mapOf("env", "test")))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..b8a814e35c6e2 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Deployments Delete. */ +public final class DeploymentsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..3c932b1d2083d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateHeapDumpSamples.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.core.util.Context; +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/2022-01-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"), + 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..d8e0a957ed313 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGenerateThreadDumpSamples.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.core.util.Context; +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/2022-01-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"), + 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..bff45c14b8ac8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetLogFileUrlSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for Deployments GetLogFileUrl. */ +public final class DeploymentsGetLogFileUrlSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..96dd8614f8369 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsGetSamples.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.core.util.Context; + +/** Samples for Deployments Get. */ +public final class DeploymentsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..a3d3e4ce68ad7 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Deployments ListForCluster. */ +public final class DeploymentsListForClusterSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, 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..be7d83700d175 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Deployments List. */ +public final class DeploymentsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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, 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..a92eda75bc126 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Deployments Restart. */ +public final class DeploymentsRestartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..426d4dcdc4cee --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsStartJfrSamples.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.core.util.Context; +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/2022-01-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"), + 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..47d91b3c355f1 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Deployments Start. */ +public final class DeploymentsStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..3cfd0ae125437 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Deployments Stop. */ +public final class DeploymentsStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..800af8ef27e64 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/DeploymentsUpdateSamples.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.generated; + +import com.azure.core.util.Context; +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/2022-01-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", 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/2022-01-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", 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(""))))) + .apply(); + } +} 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..2e32df09cd4a3 --- /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/2022-01-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..a9e9da499a14b --- /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; + +import com.azure.core.util.Context; + +/** Samples for GatewayCustomDomains Delete. */ +public final class GatewayCustomDomainsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..fd80c35e45761 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayCustomDomainsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for GatewayCustomDomains Get. */ +public final class GatewayCustomDomainsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..ed909f5d59426 --- /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; + +import com.azure.core.util.Context; + +/** Samples for GatewayCustomDomains List. */ +public final class GatewayCustomDomainsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..e621354e71743 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.appplatform.generated.models.GatewayApiRoute; +import com.azure.resourcemanager.appplatform.generated.models.GatewayRouteConfigProperties; +import java.util.Arrays; + +/** Samples for GatewayRouteConfigs CreateOrUpdate. */ +public final class GatewayRouteConfigsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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") + .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..66a7cced05940 --- /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; + +import com.azure.core.util.Context; + +/** Samples for GatewayRouteConfigs Delete. */ +public final class GatewayRouteConfigsDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..d9876f88e2e58 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsGetSamples.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.generated; + +import com.azure.core.util.Context; + +/** Samples for GatewayRouteConfigs Get. */ +public final class GatewayRouteConfigsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..eab3223090f5a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewayRouteConfigsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for GatewayRouteConfigs List. */ +public final class GatewayRouteConfigsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..a4f4425d2779e --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysCreateOrUpdateSamples.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.GatewayProperties; +import com.azure.resourcemanager.appplatform.generated.models.GatewayResourceRequests; +import com.azure.resourcemanager.appplatform.generated.models.Sku; + +/** Samples for Gateways CreateOrUpdate. */ +public final class GatewaysCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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) + .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..4db86a78bbe52 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Gateways Delete. */ +public final class GatewaysDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..24fe2ee2705a6 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Gateways Get. */ +public final class GatewaysGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..5e5fa762e2cc5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Gateways List. */ +public final class GatewaysListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} 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..6c7d27647bf32 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/GatewaysValidateDomainSamples.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.core.util.Context; +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/2022-01-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"), + 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..362aaad4320c3 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsGetSamples.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; + +import com.azure.core.util.Context; + +/** Samples for MonitoringSettings Get. */ +public final class MonitoringSettingsGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..865f5196a81b8 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePatchSamples.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.core.util.Context; +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/2022-01-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("00000000-0000-0000-0000-000000000000") + .withAppInsightsSamplingRate(10.0)), + 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..4310aba188870 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/MonitoringSettingsUpdatePutSamples.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.core.util.Context; +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/2022-01-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("00000000-0000-0000-0000-000000000000") + .withAppInsightsSamplingRate(10.0)), + 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..a4571c102d207 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/OperationsListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(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..f1db804001a4f --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/RuntimeVersionsListRuntimeVersionsSamples.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; + +import com.azure.core.util.Context; + +/** Samples for RuntimeVersions ListRuntimeVersions. */ +public final class RuntimeVersionsListRuntimeVersionsSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(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..b433492375d61 --- /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; + +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries CreateOrUpdate. */ +public final class ServiceRegistriesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..62d9454bd1255 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries Delete. */ +public final class ServiceRegistriesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..5972b260efe5e --- /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; + +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries Get. */ +public final class ServiceRegistriesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6955a3b10a5b7 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServiceRegistriesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ServiceRegistries List. */ +public final class ServiceRegistriesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..e0111668786a9 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCheckNameAvailabilitySamples.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.core.util.Context; +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/2022-01-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"), + 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..00791bf2729dd --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesCreateOrUpdateSamples.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.generated; + +import com.azure.resourcemanager.appplatform.generated.models.ClusterResourceProperties; +import com.azure.resourcemanager.appplatform.generated.models.NetworkProfile; +import com.azure.resourcemanager.appplatform.generated.models.Sku; +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/2022-01-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", "value1")) + .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"))) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", "value1")) + .withProperties(new ClusterResourceProperties()) + .withSku(new Sku().withName("S0").withTier("Standard")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..cb7500fb11bf1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services Delete. */ +public final class ServicesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6f6ce633a7128 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Services DisableTestEndpoint. */ +public final class ServicesDisableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..d9cd431258179 --- /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; + +import com.azure.core.util.Context; + +/** Samples for Services EnableTestEndpoint. */ +public final class ServicesEnableTestEndpointSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..f8365db493cfc --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesGetByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services GetByResourceGroup. */ +public final class ServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..287ae983010eb --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListByResourceGroupSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services ListByResourceGroup. */ +public final class ServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..f8ffaecd3065a --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(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..3eb04bc8aff26 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesListTestKeysSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services ListTestKeys. */ +public final class ServicesListTestKeysSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..09c0838838473 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesRegenerateTestKeySamples.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.core.util.Context; +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/2022-01-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), + 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..2fcf96ecc2aa5 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStartSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services Start. */ +public final class ServicesStartSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6ec8c783bc5d0 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesStopSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Services Stop. */ +public final class ServicesStopSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6a5f3590de989 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/ServicesUpdateSamples.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.core.util.Context; +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/2022-01-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", Context.NONE).getValue(); + resource + .update() + .withTags(mapOf("key1", "value1")) + .withProperties(new ClusterResourceProperties()) + .withSku(new Sku().withName("S0").withTier("Standard")) + .apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/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..57a6c3ad81294 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/SkusListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Skus List. */ +public final class SkusListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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(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..187403227a8c1 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesCreateOrUpdateSamples.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.StorageAccount; + +/** Samples for Storages CreateOrUpdate. */ +public final class StoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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("account-key-of-storage-account")) + .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..5cfaa70a2012d --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesDeleteSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Storages Delete. */ +public final class StoragesDeleteSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..1ce8f0a633f5d --- /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; + +import com.azure.core.util.Context; + +/** Samples for Storages Get. */ +public final class StoragesGetSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", 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..6df219368fc39 --- /dev/null +++ b/sdk/appplatform/azure-resourcemanager-appplatform-generated/src/samples/java/com/azure/resourcemanager/appplatform/generated/generated/StoragesListSamples.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; + +import com.azure.core.util.Context; + +/** Samples for Storages List. */ +public final class StoragesListSamples { + /* + * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2022-01-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", Context.NONE); + } +} diff --git a/sdk/appplatform/ci.yml b/sdk/appplatform/ci.yml new file mode 100644 index 0000000000000..377aa701b9b92 --- /dev/null +++ b/sdk/appplatform/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/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 + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: appplatform + Artifacts: + - name: azure-resourcemanager-appplatform-generated + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerappplatformgenerated diff --git a/sdk/appplatform/pom.xml b/sdk/appplatform/pom.xml new file mode 100644 index 0000000000000..3184e5d3eb121 --- /dev/null +++ b/sdk/appplatform/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-appplatform-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-appplatform-generated + + + +