diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md index 15db313586c7e..b03175dc4aa5e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0-beta.1 (2023-04-18) + +- Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-preview-2023-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md index a02875ec8d5db..07a62a10a0c69 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/README.md @@ -2,7 +2,7 @@ Azure Resource Manager ContainerAppsApi client library for Java. -This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-preview-2022-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-preview-2023-04. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-appcontainers - 1.0.0-beta.4 + 1.0.0-beta.5 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started 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. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -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 +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md index a72d4197cf51f..c6fde8bc14b00 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/SAMPLE.md @@ -105,6 +105,31 @@ - [List](#daprcomponents_list) - [ListSecrets](#daprcomponents_listsecrets) +## Jobs + +- [CreateOrUpdate](#jobs_createorupdate) +- [Delete](#jobs_delete) +- [GetByResourceGroup](#jobs_getbyresourcegroup) +- [List](#jobs_list) +- [ListByResourceGroup](#jobs_listbyresourcegroup) +- [ListSecrets](#jobs_listsecrets) +- [Start](#jobs_start) +- [StopExecution](#jobs_stopexecution) +- [StopMultipleExecutions](#jobs_stopmultipleexecutions) +- [Update](#jobs_update) + +## JobsExecutions + +- [List](#jobsexecutions_list) + +## ManagedCertificates + +- [CreateOrUpdate](#managedcertificates_createorupdate) +- [Delete](#managedcertificates_delete) +- [Get](#managedcertificates_get) +- [List](#managedcertificates_list) +- [Update](#managedcertificates_update) + ## ManagedEnvironmentDiagnostics - [GetDetector](#managedenvironmentdiagnostics_getdetector) @@ -142,12 +167,10 @@ ### AvailableWorkloadProfiles_Get ```java -import com.azure.core.util.Context; - /** Samples for AvailableWorkloadProfiles Get. */ public final class AvailableWorkloadProfilesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AvailableWorkloadProfiles_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AvailableWorkloadProfiles_Get.json */ /** * Sample code: BillingMeters_Get. @@ -155,7 +178,7 @@ public final class AvailableWorkloadProfilesGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.availableWorkloadProfiles().get("East US", Context.NONE); + manager.availableWorkloadProfiles().get("East US", com.azure.core.util.Context.NONE); } } ``` @@ -163,12 +186,10 @@ public final class AvailableWorkloadProfilesGetSamples { ### BillingMeters_Get ```java -import com.azure.core.util.Context; - /** Samples for BillingMeters Get. */ public final class BillingMetersGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/BillingMeters_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/BillingMeters_Get.json */ /** * Sample code: BillingMeters_Get. @@ -176,7 +197,7 @@ public final class BillingMetersGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.billingMeters().getWithResponse("East US", Context.NONE); + manager.billingMeters().getWithResponse("East US", com.azure.core.util.Context.NONE); } } ``` @@ -184,12 +205,13 @@ public final class BillingMetersGetSamples { ### Certificates_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; import com.azure.resourcemanager.appcontainers.models.CertificateProperties; /** Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -200,14 +222,17 @@ public final class CertificatesCreateOrUpdateSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .certificates() - .define("certificate-firendly-name") - .withRegion("East US") - .withExistingManagedEnvironment("examplerg", "testcontainerenv") - .withProperties( - new CertificateProperties() - .withPassword("private key password") - .withValue("PFX-or-PEM-blob".getBytes())) - .create(); + .createOrUpdateWithResponse( + "examplerg", + "testcontainerenv", + "certificate-firendly-name", + new CertificateInner() + .withLocation("East US") + .withProperties( + new CertificateProperties() + .withPassword("fakeTokenPlaceholder") + .withValue("Y2VydA==".getBytes())), + com.azure.core.util.Context.NONE); } } ``` @@ -215,12 +240,10 @@ public final class CertificatesCreateOrUpdateSamples { ### Certificates_Delete ```java -import com.azure.core.util.Context; - /** Samples for Certificates Delete. */ public final class CertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -230,7 +253,8 @@ public final class CertificatesDeleteSamples { public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .certificates() - .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .deleteWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } ``` @@ -238,12 +262,10 @@ public final class CertificatesDeleteSamples { ### Certificates_Get ```java -import com.azure.core.util.Context; - /** Samples for Certificates Get. */ public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificate_Get.json */ /** * Sample code: Get Certificate. @@ -253,7 +275,8 @@ public final class CertificatesGetSamples { public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .certificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } ``` @@ -261,12 +284,10 @@ public final class CertificatesGetSamples { ### Certificates_List ```java -import com.azure.core.util.Context; - /** Samples for Certificates List. */ public final class CertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificates_ListByManagedEnvironment.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificates_ListByManagedEnvironment.json */ /** * Sample code: List Certificates by Managed Environment. @@ -275,7 +296,7 @@ public final class CertificatesListSamples { */ public static void listCertificatesByManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().list("examplerg", "testcontainerenv", Context.NONE); + manager.certificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } } ``` @@ -283,15 +304,14 @@ public final class CertificatesListSamples { ### Certificates_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.models.Certificate; +import com.azure.resourcemanager.appcontainers.models.CertificatePatch; import java.util.HashMap; import java.util.Map; /** Samples for Certificates Update. */ public final class CertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificates_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -299,12 +319,14 @@ public final class CertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - Certificate resource = - manager - .certificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + manager + .certificates() + .updateWithResponse( + "examplerg", + "testcontainerenv", + "certificate-firendly-name", + new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -323,13 +345,12 @@ public final class CertificatesUpdateSamples { ### ConnectedEnvironments_CheckNameAvailability ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; /** Samples for ConnectedEnvironments CheckNameAvailability. */ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -346,7 +367,7 @@ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { new CheckNameAvailabilityRequest() .withName("testcertificatename") .withType("Microsoft.App/connectedEnvironments/certificates"), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -359,7 +380,7 @@ import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; /** Samples for ConnectedEnvironments CreateOrUpdate. */ public final class ConnectedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create kube environments. @@ -378,8 +399,8 @@ public final class ConnectedEnvironmentsCreateOrUpdateSamples { .withCustomDomainConfiguration( new CustomDomainConfiguration() .withDnsSuffix("www.my-name.com") - .withCertificateValue("PFX-or-PEM-blob".getBytes()) - .withCertificatePassword("private key password".getBytes())) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .create(); } } @@ -388,12 +409,10 @@ public final class ConnectedEnvironmentsCreateOrUpdateSamples { ### ConnectedEnvironments_Delete ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments Delete. */ public final class ConnectedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_Delete.json */ /** * Sample code: Delete connected environment by connectedEnvironmentName. @@ -402,7 +421,7 @@ public final class ConnectedEnvironmentsDeleteSamples { */ public static void deleteConnectedEnvironmentByConnectedEnvironmentName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + manager.connectedEnvironments().delete("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } ``` @@ -410,12 +429,10 @@ public final class ConnectedEnvironmentsDeleteSamples { ### ConnectedEnvironments_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments GetByResourceGroup. */ public final class ConnectedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_Get.json */ /** * Sample code: Get connected environment by connectedEnvironmentName. @@ -424,7 +441,9 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { */ public static void getConnectedEnvironmentByConnectedEnvironmentName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().getByResourceGroupWithResponse("examplerg", "examplekenv", Context.NONE); + manager + .connectedEnvironments() + .getByResourceGroupWithResponse("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } ``` @@ -432,12 +451,10 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { ### ConnectedEnvironments_List ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments List. */ public final class ConnectedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_ListBySubscription.json */ /** * Sample code: List connected environments by subscription. @@ -446,7 +463,7 @@ public final class ConnectedEnvironmentsListSamples { */ public static void listConnectedEnvironmentsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().list(Context.NONE); + manager.connectedEnvironments().list(com.azure.core.util.Context.NONE); } } ``` @@ -454,12 +471,10 @@ public final class ConnectedEnvironmentsListSamples { ### ConnectedEnvironments_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments ListByResourceGroup. */ public final class ConnectedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_ListByResourceGroup.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_ListByResourceGroup.json */ /** * Sample code: List environments by resource group. @@ -468,7 +483,7 @@ public final class ConnectedEnvironmentsListByResourceGroupSamples { */ public static void listEnvironmentsByResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().listByResourceGroup("examplerg", Context.NONE); + manager.connectedEnvironments().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } ``` @@ -476,12 +491,10 @@ public final class ConnectedEnvironmentsListByResourceGroupSamples { ### ConnectedEnvironments_Update ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments Update. */ public final class ConnectedEnvironmentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_Patch.json */ /** * Sample code: Patch Managed Environment. @@ -490,7 +503,7 @@ public final class ConnectedEnvironmentsUpdateSamples { */ public static void patchManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().updateWithResponse("examplerg", "testenv", Context.NONE); + manager.connectedEnvironments().updateWithResponse("examplerg", "testenv", com.azure.core.util.Context.NONE); } } ``` @@ -498,14 +511,12 @@ public final class ConnectedEnvironmentsUpdateSamples { ### ConnectedEnvironmentsCertificates_CreateOrUpdate ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; import com.azure.resourcemanager.appcontainers.models.CertificateProperties; /** Samples for ConnectedEnvironmentsCertificates CreateOrUpdate. */ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -516,17 +527,12 @@ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsCertificates() - .createOrUpdateWithResponse( - "examplerg", - "testcontainerenv", - "certificate-firendly-name", - new CertificateInner() - .withLocation("East US") - .withProperties( - new CertificateProperties() - .withPassword("private key password") - .withValue("PFX-or-PEM-blob".getBytes())), - Context.NONE); + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingConnectedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new CertificateProperties().withPassword("fakeTokenPlaceholder").withValue("Y2VydA==".getBytes())) + .create(); } } ``` @@ -534,12 +540,10 @@ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { ### ConnectedEnvironmentsCertificates_Delete ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsCertificates Delete. */ public final class ConnectedEnvironmentsCertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificate_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -549,7 +553,8 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsCertificates() - .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .deleteWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } ``` @@ -557,12 +562,10 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { ### ConnectedEnvironmentsCertificates_Get ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsCertificates Get. */ public final class ConnectedEnvironmentsCertificatesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificate_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificate_Get.json */ /** * Sample code: Get Certificate. @@ -572,7 +575,8 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsCertificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } ``` @@ -580,12 +584,10 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { ### ConnectedEnvironmentsCertificates_List ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsCertificates List. */ public final class ConnectedEnvironmentsCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json */ /** * Sample code: List Certificates by Connected Environment. @@ -594,7 +596,9 @@ public final class ConnectedEnvironmentsCertificatesListSamples { */ public static void listCertificatesByConnectedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates().list("examplerg", "testcontainerenv", Context.NONE); + manager + .connectedEnvironmentsCertificates() + .list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } } ``` @@ -602,15 +606,14 @@ public final class ConnectedEnvironmentsCertificatesListSamples { ### ConnectedEnvironmentsCertificates_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.models.CertificatePatch; +import com.azure.resourcemanager.appcontainers.models.Certificate; import java.util.HashMap; import java.util.Map; /** Samples for ConnectedEnvironmentsCertificates Update. */ public final class ConnectedEnvironmentsCertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificates_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -618,14 +621,13 @@ public final class ConnectedEnvironmentsCertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager - .connectedEnvironmentsCertificates() - .updateWithResponse( - "examplerg", - "testcontainerenv", - "certificate-firendly-name", - new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), - Context.NONE); + Certificate resource = + manager + .connectedEnvironmentsCertificates() + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } @SuppressWarnings("unchecked") @@ -644,8 +646,6 @@ public final class ConnectedEnvironmentsCertificatesUpdateSamples { ### ConnectedEnvironmentsDaprComponents_CreateOrUpdate ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Arrays; @@ -653,7 +653,7 @@ import java.util.Arrays; /** Samples for ConnectedEnvironmentsDaprComponents CreateOrUpdate. */ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json */ /** * Sample code: Create or update dapr component. @@ -664,25 +664,22 @@ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .createOrUpdateWithResponse( - "examplerg", - "myenvironment", - "reddog", - new DaprComponentInner() - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")), - Context.NONE); + .define("reddog") + .withExistingConnectedEnvironment("examplerg", "myenvironment") + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .create(); } } ``` @@ -690,12 +687,10 @@ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { ### ConnectedEnvironmentsDaprComponents_Delete ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents Delete. */ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -705,7 +700,7 @@ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .deleteWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -713,12 +708,10 @@ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { ### ConnectedEnvironmentsDaprComponents_Get ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents Get. */ public final class ConnectedEnvironmentsDaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json */ /** * Sample code: Get Dapr Component. @@ -728,7 +721,7 @@ public final class ConnectedEnvironmentsDaprComponentsGetSamples { public static void getDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -736,12 +729,10 @@ public final class ConnectedEnvironmentsDaprComponentsGetSamples { ### ConnectedEnvironmentsDaprComponents_List ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents List. */ public final class ConnectedEnvironmentsDaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -749,7 +740,9 @@ public final class ConnectedEnvironmentsDaprComponentsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().list("examplerg", "myenvironment", Context.NONE); + manager + .connectedEnvironmentsDaprComponents() + .list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` @@ -757,12 +750,10 @@ public final class ConnectedEnvironmentsDaprComponentsListSamples { ### ConnectedEnvironmentsDaprComponents_ListSecrets ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents ListSecrets. */ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -773,7 +764,7 @@ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .listSecretsWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -788,7 +779,7 @@ import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorag /** Samples for ConnectedEnvironmentsStorages CreateOrUpdate. */ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json */ /** * Sample code: Create or update environments storage. @@ -806,7 +797,7 @@ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { .withAzureFile( new AzureFileProperties() .withAccountName("account1") - .withAccountKey("key") + .withAccountKey("fakeTokenPlaceholder") .withAccessMode(AccessMode.READ_ONLY) .withShareName("share1"))) .create(); @@ -817,12 +808,10 @@ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { ### ConnectedEnvironmentsStorages_Delete ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsStorages Delete. */ public final class ConnectedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -831,7 +820,9 @@ public final class ConnectedEnvironmentsStoragesDeleteSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().deleteWithResponse("examplerg", "env", "jlaw-demo1", Context.NONE); + manager + .connectedEnvironmentsStorages() + .deleteWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -839,12 +830,10 @@ public final class ConnectedEnvironmentsStoragesDeleteSamples { ### ConnectedEnvironmentsStorages_Get ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsStorages Get. */ public final class ConnectedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage properties by subscription. @@ -853,7 +842,9 @@ public final class ConnectedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStoragePropertiesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().getWithResponse("examplerg", "env", "jlaw-demo1", Context.NONE); + manager + .connectedEnvironmentsStorages() + .getWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -861,12 +852,10 @@ public final class ConnectedEnvironmentsStoragesGetSamples { ### ConnectedEnvironmentsStorages_List ```java -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsStorages List. */ public final class ConnectedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -875,7 +864,9 @@ public final class ConnectedEnvironmentsStoragesListSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + manager + .connectedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } ``` @@ -884,6 +875,7 @@ public final class ConnectedEnvironmentsStoragesListSamples { ```java import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.Affinity; import com.azure.resourcemanager.appcontainers.models.AppProtocol; import com.azure.resourcemanager.appcontainers.models.BindingType; import com.azure.resourcemanager.appcontainers.models.Configuration; @@ -893,10 +885,13 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.CorsPolicy; import com.azure.resourcemanager.appcontainers.models.CustomDomain; import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; import com.azure.resourcemanager.appcontainers.models.Ingress; +import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode; +import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; @@ -914,7 +909,7 @@ import java.util.Map; /** Samples for ContainerApps CreateOrUpdate. */ public final class ContainerAppsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App. @@ -930,7 +925,7 @@ public final class ContainerAppsCreateOrUpdateSamples { .withExistingResourceGroup("rg") .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withWorkloadProfileType("GeneralPurpose") + .withWorkloadProfileName("My-GP-01") .withConfiguration( new Configuration() .withIngress( @@ -971,7 +966,17 @@ public final class ContainerAppsCreateOrUpdateSamples { .withDescription( "Allowing all IP's within the subnet below to access containerapp") .withIpAddressRange("192.168.1.1/8") - .withAction(Action.ALLOW)))) + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy( + new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true))) .withDapr( new Dapr() .withEnabled(true) @@ -1033,7 +1038,7 @@ public final class ContainerAppsCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json */ /** * Sample code: Create or Update Tcp App. @@ -1093,6 +1098,70 @@ public final class ContainerAppsCreateOrUpdateSamples { .create(); } + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update ManagedBy App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateManagedByApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .containerApps() + .define("testcontainerAppManagedBy") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedBy( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerAppManagedBy-ab1234") + .withWeight(100))))) + .withTemplate( + new Template() + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerAppManagedBy:v1") + .withName("testcontainerAppManagedBy") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) + .withType(Type.LIVENESS))))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("tcpscalingrule") + .withTcp( + new TcpScaleRule() + .withMetadata(mapOf("concurrentConnections", "50"))))))) + .create(); + } + @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -1109,12 +1178,10 @@ public final class ContainerAppsCreateOrUpdateSamples { ### ContainerApps_Delete ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps Delete. */ public final class ContainerAppsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Delete.json */ /** * Sample code: Delete Container App. @@ -1122,7 +1189,7 @@ public final class ContainerAppsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().delete("rg", "testWorkerApp0", Context.NONE); + manager.containerApps().delete("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -1130,12 +1197,10 @@ public final class ContainerAppsDeleteSamples { ### ContainerApps_GetAuthToken ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps GetAuthToken. */ public final class ContainerAppsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_GetAuthToken.json */ /** * Sample code: Get Container App Auth Token. @@ -1144,7 +1209,7 @@ public final class ContainerAppsGetAuthTokenSamples { */ public static void getContainerAppAuthToken( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerApp0", Context.NONE); + manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -1152,12 +1217,10 @@ public final class ContainerAppsGetAuthTokenSamples { ### ContainerApps_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps GetByResourceGroup. */ public final class ContainerAppsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -1165,7 +1228,9 @@ public final class ContainerAppsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE); + manager + .containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -1173,12 +1238,10 @@ public final class ContainerAppsGetByResourceGroupSamples { ### ContainerApps_List ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps List. */ public final class ContainerAppsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListBySubscription.json */ /** * Sample code: List Container Apps by subscription. @@ -1187,7 +1250,7 @@ public final class ContainerAppsListSamples { */ public static void listContainerAppsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().list(Context.NONE); + manager.containerApps().list(com.azure.core.util.Context.NONE); } } ``` @@ -1195,12 +1258,10 @@ public final class ContainerAppsListSamples { ### ContainerApps_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps ListByResourceGroup. */ public final class ContainerAppsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListByResourceGroup.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListByResourceGroup.json */ /** * Sample code: List Container Apps by resource group. @@ -1209,7 +1270,7 @@ public final class ContainerAppsListByResourceGroupSamples { */ public static void listContainerAppsByResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listByResourceGroup("rg", Context.NONE); + manager.containerApps().listByResourceGroup("rg", com.azure.core.util.Context.NONE); } } ``` @@ -1217,12 +1278,10 @@ public final class ContainerAppsListByResourceGroupSamples { ### ContainerApps_ListCustomHostnameAnalysis ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps ListCustomHostnameAnalysis. */ public final class ContainerAppsListCustomHostnameAnalysisSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json */ /** * Sample code: Analyze Custom Hostname. @@ -1232,7 +1291,8 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerApps() - .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", Context.NONE); + .listCustomHostnameAnalysisWithResponse( + "rg", "testcontainerApp0", "my.name.corp", com.azure.core.util.Context.NONE); } } ``` @@ -1240,12 +1300,10 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { ### ContainerApps_ListSecrets ```java -import com.azure.core.util.Context; - /** Samples for ContainerApps ListSecrets. */ public final class ContainerAppsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -1254,7 +1312,7 @@ public final class ContainerAppsListSecretsSamples { */ public static void listContainerAppsSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", Context.NONE); + manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -1262,13 +1320,13 @@ public final class ContainerAppsListSecretsSamples { ### ContainerApps_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.Affinity; import com.azure.resourcemanager.appcontainers.models.AppProtocol; import com.azure.resourcemanager.appcontainers.models.BindingType; import com.azure.resourcemanager.appcontainers.models.Configuration; import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerApp; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; @@ -1277,6 +1335,7 @@ import com.azure.resourcemanager.appcontainers.models.CustomDomain; import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; import com.azure.resourcemanager.appcontainers.models.Ingress; +import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; import com.azure.resourcemanager.appcontainers.models.LogLevel; @@ -1292,7 +1351,7 @@ import java.util.Map; /** Samples for ContainerApps Update. */ public final class ContainerAppsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Patch.json */ /** * Sample code: Patch Container App. @@ -1300,133 +1359,132 @@ public final class ContainerAppsUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager - .containerApps() - .update( - "rg", - "testcontainerApp0", - new ContainerAppInner() - .withLocation("East US") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withConfiguration( - new Configuration() - .withIngress( - new Ingress() - .withExternal(true) - .withTargetPort(3000) - .withTraffic( - Arrays - .asList( - new TrafficWeight() - .withRevisionName("testcontainerApp0-ab1234") - .withWeight(100) - .withLabel("production"))) - .withCustomDomains( - Arrays - .asList( - new CustomDomain() - .withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain() - .withName("www.my-other-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions( - Arrays - .asList( - new IpSecurityRestrictionRule() - .withName("Allow work IP A subnet") - .withDescription( - "Allowing all IP's within the subnet below to access" - + " containerapp") - .withIpAddressRange("192.168.1.1/32") - .withAction(Action.ALLOW), - new IpSecurityRestrictionRule() - .withName("Allow work IP B subnet") - .withDescription( - "Allowing all IP's within the subnet below to access" - + " containerapp") - .withIpAddressRange("192.168.1.1/8") - .withAction(Action.ALLOW)))) - .withDapr( - new Dapr() - .withEnabled(true) - .withAppProtocol(AppProtocol.HTTP) - .withAppPort(3000) - .withHttpReadBufferSize(30) - .withHttpMaxRequestSize(10) - .withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10)) - .withTemplate( - new Template() - .withInitContainers( + ContainerApp resource = + manager + .containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .withTraffic( Arrays .asList( - new InitContainer() - .withImage("repo/testcontainerApp0:v4") - .withName("testinitcontainerApp0") - .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers( + new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains( Arrays .asList( - new Container() - .withImage("repo/testcontainerApp0:v1") - .withName("testcontainerApp0") - .withProbes( - Arrays - .asList( - new ContainerAppProbe() - .withHttpGet( - new ContainerAppProbeHttpGet() - .withHttpHeaders( - Arrays - .asList( - new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header") - .withValue("Awesome"))) - .withPath("/health") - .withPort(8080)) - .withInitialDelaySeconds(3) - .withPeriodSeconds(3) - .withType(Type.LIVENESS))))) - .withScale( - new Scale() - .withMinReplicas(1) - .withMaxReplicas(5) - .withRules( - Arrays - .asList( - new ScaleRule() - .withName("httpscalingrule") - .withCustom( - new CustomScaleRule() - .withType("http") - .withMetadata(mapOf("concurrentRequests", "50"))))))), - Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} -``` - -### ContainerAppsAuthConfigs_CreateOrUpdate - -```java -import com.azure.resourcemanager.appcontainers.models.AppRegistration; -import com.azure.resourcemanager.appcontainers.models.AuthPlatform; + new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain() + .withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( + Arrays + .asList( + new IpSecurityRestrictionRule() + .withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule() + .withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) + .withDapr( + new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withMaxInactiveRevisions(10)) + .withTemplate( + new Template() + .withInitContainers( + Arrays + .asList( + new InitContainer() + .withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("httpscalingrule") + .withCustom( + new CustomScaleRule() + .withType("http") + .withMetadata(mapOf("concurrentRequests", "50"))))))) + .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; + } +} +``` + +### ContainerAppsAuthConfigs_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.AppRegistration; +import com.azure.resourcemanager.appcontainers.models.AuthPlatform; import com.azure.resourcemanager.appcontainers.models.Facebook; import com.azure.resourcemanager.appcontainers.models.GlobalValidation; import com.azure.resourcemanager.appcontainers.models.IdentityProviders; @@ -1435,7 +1493,7 @@ import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActio /** Samples for ContainerAppsAuthConfigs CreateOrUpdate. */ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App AuthConfig. @@ -1456,7 +1514,9 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { .withFacebook( new Facebook() .withRegistration( - new AppRegistration().withAppId("123").withAppSecretSettingName("facebook-secret")))) + new AppRegistration() + .withAppId("123") + .withAppSecretSettingName("fakeTokenPlaceholder")))) .create(); } } @@ -1465,12 +1525,10 @@ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { ### ContainerAppsAuthConfigs_Delete ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsAuthConfigs Delete. */ public final class ContainerAppsAuthConfigsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_Delete.json */ /** * Sample code: Delete Container App AuthConfig. @@ -1481,7 +1539,7 @@ public final class ContainerAppsAuthConfigsDeleteSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsAuthConfigs() - .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -1489,12 +1547,10 @@ public final class ContainerAppsAuthConfigsDeleteSamples { ### ContainerAppsAuthConfigs_Get ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsAuthConfigs Get. */ public final class ContainerAppsAuthConfigsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_Get.json */ /** * Sample code: Get Container App's AuthConfig. @@ -1505,7 +1561,7 @@ public final class ContainerAppsAuthConfigsGetSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsAuthConfigs() - .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -1513,12 +1569,10 @@ public final class ContainerAppsAuthConfigsGetSamples { ### ContainerAppsAuthConfigs_ListByContainerApp ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsAuthConfigs ListByContainerApp. */ public final class ContainerAppsAuthConfigsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_ListByContainer.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_ListByContainer.json */ /** * Sample code: List Auth Configs by Container Apps. @@ -1527,7 +1581,9 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { */ public static void listAuthConfigsByContainerApps( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + manager + .containerAppsAuthConfigs() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); } } ``` @@ -1535,12 +1591,10 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { ### ContainerAppsDiagnostics_GetDetector ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics GetDetector. */ public final class ContainerAppsDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerAppsDiagnostics_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerAppsDiagnostics_Get.json */ /** * Sample code: Get Container App's diagnostics info. @@ -1552,7 +1606,10 @@ public final class ContainerAppsDiagnosticsGetDetectorSamples { manager .containerAppsDiagnostics() .getDetectorWithResponse( - "mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", Context.NONE); + "mikono-workerapp-test-rg", + "mikono-capp-stage1", + "cappcontainerappnetworkIO", + com.azure.core.util.Context.NONE); } } ``` @@ -1560,12 +1617,10 @@ public final class ContainerAppsDiagnosticsGetDetectorSamples { ### ContainerAppsDiagnostics_GetRevision ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics GetRevision. */ public final class ContainerAppsDiagnosticsGetRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -1576,7 +1631,8 @@ public final class ContainerAppsDiagnosticsGetRevisionSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsDiagnostics() - .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .getRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } ``` @@ -1584,12 +1640,10 @@ public final class ContainerAppsDiagnosticsGetRevisionSamples { ### ContainerAppsDiagnostics_GetRoot ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics GetRoot. */ public final class ContainerAppsDiagnosticsGetRootSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -1597,7 +1651,9 @@ public final class ContainerAppsDiagnosticsGetRootSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().getRootWithResponse("rg", "testcontainerApp0", Context.NONE); + manager + .containerAppsDiagnostics() + .getRootWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } ``` @@ -1605,12 +1661,10 @@ public final class ContainerAppsDiagnosticsGetRootSamples { ### ContainerAppsDiagnostics_ListDetectors ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics ListDetectors. */ public final class ContainerAppsDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerAppsDiagnostics_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerAppsDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostics for a given Container App. @@ -1621,7 +1675,7 @@ public final class ContainerAppsDiagnosticsListDetectorsSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsDiagnostics() - .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", Context.NONE); + .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", com.azure.core.util.Context.NONE); } } ``` @@ -1629,12 +1683,10 @@ public final class ContainerAppsDiagnosticsListDetectorsSamples { ### ContainerAppsDiagnostics_ListRevisions ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics ListRevisions. */ public final class ContainerAppsDiagnosticsListRevisionsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -1643,7 +1695,9 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { */ public static void listContainerAppSRevisions( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().listRevisions("rg", "testcontainerApp0", null, Context.NONE); + manager + .containerAppsDiagnostics() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); } } ``` @@ -1651,12 +1705,10 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { ### ContainerAppsRevisionReplicas_GetReplica ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisionReplicas GetReplica. */ public final class ContainerAppsRevisionReplicasGetReplicaSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Replicas_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Replicas_Get.json */ /** * Sample code: Get Container App's revision replica. @@ -1668,7 +1720,11 @@ public final class ContainerAppsRevisionReplicasGetReplicaSamples { manager .containerAppsRevisionReplicas() .getReplicaWithResponse( - "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", Context.NONE); + "workerapps-rg-xj", + "myapp", + "myapp--0wlqy09", + "myapp--0wlqy09-5d9774cff-5wnd8", + com.azure.core.util.Context.NONE); } } ``` @@ -1676,12 +1732,10 @@ public final class ContainerAppsRevisionReplicasGetReplicaSamples { ### ContainerAppsRevisionReplicas_ListReplicas ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisionReplicas ListReplicas. */ public final class ContainerAppsRevisionReplicasListReplicasSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Replicas_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Replicas_List.json */ /** * Sample code: List Container App's replicas. @@ -1692,7 +1746,7 @@ public final class ContainerAppsRevisionReplicasListReplicasSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisionReplicas() - .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", Context.NONE); + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", com.azure.core.util.Context.NONE); } } ``` @@ -1700,12 +1754,10 @@ public final class ContainerAppsRevisionReplicasListReplicasSamples { ### ContainerAppsRevisions_ActivateRevision ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions ActivateRevision. */ public final class ContainerAppsRevisionsActivateRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Activate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Activate.json */ /** * Sample code: Activate Container App's revision. @@ -1716,7 +1768,8 @@ public final class ContainerAppsRevisionsActivateRevisionSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .activateRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } ``` @@ -1724,12 +1777,10 @@ public final class ContainerAppsRevisionsActivateRevisionSamples { ### ContainerAppsRevisions_DeactivateRevision ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions DeactivateRevision. */ public final class ContainerAppsRevisionsDeactivateRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Deactivate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Deactivate.json */ /** * Sample code: Deactivate Container App's revision. @@ -1740,7 +1791,8 @@ public final class ContainerAppsRevisionsDeactivateRevisionSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .deactivateRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } ``` @@ -1748,12 +1800,10 @@ public final class ContainerAppsRevisionsDeactivateRevisionSamples { ### ContainerAppsRevisions_GetRevision ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions GetRevision. */ public final class ContainerAppsRevisionsGetRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -1764,7 +1814,8 @@ public final class ContainerAppsRevisionsGetRevisionSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .getRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } ``` @@ -1772,12 +1823,10 @@ public final class ContainerAppsRevisionsGetRevisionSamples { ### ContainerAppsRevisions_ListRevisions ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions ListRevisions. */ public final class ContainerAppsRevisionsListRevisionsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -1786,7 +1835,9 @@ public final class ContainerAppsRevisionsListRevisionsSamples { */ public static void listContainerAppSRevisions( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", null, Context.NONE); + manager + .containerAppsRevisions() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); } } ``` @@ -1794,12 +1845,10 @@ public final class ContainerAppsRevisionsListRevisionsSamples { ### ContainerAppsRevisions_RestartRevision ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions RestartRevision. */ public final class ContainerAppsRevisionsRestartRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Restart.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Restart.json */ /** * Sample code: Restart Container App's revision. @@ -1810,7 +1859,8 @@ public final class ContainerAppsRevisionsRestartRevisionSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", Context.NONE); + .restartRevisionWithResponse( + "rg", "testStaticSite0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } ``` @@ -1825,7 +1875,7 @@ import com.azure.resourcemanager.appcontainers.models.RegistryInfo; /** Samples for ContainerAppsSourceControls CreateOrUpdate. */ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App SourceControl. @@ -1846,11 +1896,11 @@ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { new RegistryInfo() .withRegistryUrl("xwang971reg.azurecr.io") .withRegistryUsername("xwang971reg") - .withRegistryPassword("")) + .withRegistryPassword("fakeTokenPlaceholder")) .withAzureCredentials( new AzureCredentials() .withClientId("") - .withClientSecret("") + .withClientSecret("fakeTokenPlaceholder") .withTenantId("")) .withContextPath("./") .withImage("image/tag")) @@ -1862,12 +1912,10 @@ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { ### ContainerAppsSourceControls_Delete ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsSourceControls Delete. */ public final class ContainerAppsSourceControlsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_Delete.json */ /** * Sample code: Delete Container App SourceControl. @@ -1876,7 +1924,9 @@ public final class ContainerAppsSourceControlsDeleteSamples { */ public static void deleteContainerAppSourceControl( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + manager + .containerAppsSourceControls() + .delete("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -1884,12 +1934,10 @@ public final class ContainerAppsSourceControlsDeleteSamples { ### ContainerAppsSourceControls_Get ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsSourceControls Get. */ public final class ContainerAppsSourceControlsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_Get.json */ /** * Sample code: Get Container App's SourceControl. @@ -1900,7 +1948,7 @@ public final class ContainerAppsSourceControlsGetSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsSourceControls() - .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } ``` @@ -1908,12 +1956,10 @@ public final class ContainerAppsSourceControlsGetSamples { ### ContainerAppsSourceControls_ListByContainerApp ```java -import com.azure.core.util.Context; - /** Samples for ContainerAppsSourceControls ListByContainerApp. */ public final class ContainerAppsSourceControlsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_ListByContainer.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_ListByContainer.json */ /** * Sample code: List App's Source Controls. @@ -1921,7 +1967,9 @@ public final class ContainerAppsSourceControlsListByContainerAppSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listAppSSourceControls(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + manager + .containerAppsSourceControls() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); } } ``` @@ -1929,6 +1977,7 @@ public final class ContainerAppsSourceControlsListByContainerAppSamples { ### DaprComponents_CreateOrUpdate ```java +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Arrays; @@ -1936,7 +1985,7 @@ import java.util.Arrays; /** Samples for DaprComponents CreateOrUpdate. */ public final class DaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json */ /** * Sample code: Create or update dapr component with secrets. @@ -1947,26 +1996,29 @@ public final class DaprComponentsCreateOrUpdateSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .daprComponents() - .define("reddog") - .withExistingManagedEnvironment("examplerg", "myenvironment") - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .create(); + .createOrUpdateWithResponse( + "examplerg", + "myenvironment", + "reddog", + new DaprComponentInner() + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json */ /** * Sample code: Create or update dapr component with secret store component. @@ -1977,22 +2029,25 @@ public final class DaprComponentsCreateOrUpdateSamples { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .daprComponents() - .define("reddog") - .withExistingManagedEnvironment("examplerg", "myenvironment") - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecretStoreComponent("my-secret-store") - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .create(); + .createOrUpdateWithResponse( + "examplerg", + "myenvironment", + "reddog", + new DaprComponentInner() + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecretStoreComponent("fakeTokenPlaceholder") + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")), + com.azure.core.util.Context.NONE); } } ``` @@ -2000,12 +2055,10 @@ public final class DaprComponentsCreateOrUpdateSamples { ### DaprComponents_Delete ```java -import com.azure.core.util.Context; - /** Samples for DaprComponents Delete. */ public final class DaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -2013,7 +2066,9 @@ public final class DaprComponentsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().deleteWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -2021,12 +2076,10 @@ public final class DaprComponentsDeleteSamples { ### DaprComponents_Get ```java -import com.azure.core.util.Context; - /** Samples for DaprComponents Get. */ public final class DaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_Get_SecretStoreComponent.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_Get_SecretStoreComponent.json */ /** * Sample code: Get Dapr Component with secret store component. @@ -2035,11 +2088,13 @@ public final class DaprComponentsGetSamples { */ public static void getDaprComponentWithSecretStoreComponent( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_Get_Secrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_Get_Secrets.json */ /** * Sample code: Get Dapr Component with secrets. @@ -2048,7 +2103,9 @@ public final class DaprComponentsGetSamples { */ public static void getDaprComponentWithSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` @@ -2056,12 +2113,10 @@ public final class DaprComponentsGetSamples { ### DaprComponents_List ```java -import com.azure.core.util.Context; - /** Samples for DaprComponents List. */ public final class DaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -2069,7 +2124,7 @@ public final class DaprComponentsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().list("examplerg", "myenvironment", Context.NONE); + manager.daprComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } ``` @@ -2077,12 +2132,10 @@ public final class DaprComponentsListSamples { ### DaprComponents_ListSecrets ```java -import com.azure.core.util.Context; - /** Samples for DaprComponents ListSecrets. */ public final class DaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -2091,56 +2144,581 @@ public final class DaprComponentsListSecretsSamples { */ public static void listContainerAppsSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().listSecretsWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } ``` -### ManagedEnvironmentDiagnostics_GetDetector +### Jobs_CreateOrUpdate ```java -import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.TriggerType; +import com.azure.resourcemanager.appcontainers.models.Type; +import java.util.Arrays; -/** Samples for ManagedEnvironmentDiagnostics GetDetector. */ -public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { +/** Samples for Jobs CreateOrUpdate. */ +public final class JobsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentDiagnostics_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_CreateorUpdate.json */ /** - * Sample code: Get diagnostic data for a managed environments. + * Sample code: Create or Update Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getDiagnosticDataForAManagedEnvironments( + public static void createOrUpdateContainerAppsJob( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager - .managedEnvironmentDiagnostics() - .getDetectorWithResponse( - "mikono-workerapp-test-rg", "mikonokubeenv", "ManagedEnvAvailabilityMetrics", Context.NONE); + .jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new JobConfiguration() + .withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + .withTemplate( + new JobTemplate() + .withInitContainers( + Arrays + .asList( + new InitContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) + .create(); } } ``` -### ManagedEnvironmentDiagnostics_ListDetectors +### Jobs_Delete ```java -import com.azure.core.util.Context; - -/** Samples for ManagedEnvironmentDiagnostics ListDetectors. */ -public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { +/** Samples for Jobs Delete. */ +public final class JobsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentDiagnostics_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Delete.json */ /** - * Sample code: Get the list of available diagnostic data for a managed environments. + * Sample code: Delete Container Apps Job. * * @param manager Entry point to ContainerAppsApiManager. */ - public static void getTheListOfAvailableDiagnosticDataForAManagedEnvironments( + public static void deleteContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().delete("rg", "testWorkerContainerAppsJob0", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_GetByResourceGroup + +```java +/** Samples for Jobs GetByResourceGroup. */ +public final class JobsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Get.json + */ + /** + * Sample code: Get Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_List + +```java +/** Samples for Jobs List. */ +public final class JobsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Jobs_ListBySubscription.json + */ + /** + * Sample code: List Container Apps Jobs by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsJobsBySubscription( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_ListByResourceGroup + +```java +/** Samples for Jobs ListByResourceGroup. */ +public final class JobsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Jobs_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps Jobs by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsJobsByResourceGroup( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_ListSecrets + +```java +/** Samples for Jobs ListSecrets. */ +public final class JobsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_ListSecrets.json + */ + /** + * Sample code: List Container Apps Job Secrets. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsJobSecrets( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().listSecretsWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Start + +```java +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.JobExecutionContainer; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import java.util.Arrays; + +/** Samples for Jobs Start. */ +public final class JobsStartSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Start.json + */ + /** + * Sample code: Run a Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void runAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .jobs() + .start( + "rg", + "testcontainerAppsJob0", + new JobExecutionTemplate() + .withContainers( + Arrays + .asList( + new JobExecutionContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testcontainerAppsJob0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withInitContainers( + Arrays + .asList( + new JobExecutionContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_StopExecution + +```java +/** Samples for Jobs StopExecution. */ +public final class JobsStopExecutionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Stop_Execution.json + */ + /** + * Sample code: Terminate a Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void terminateAContainerAppsJob( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().stopExecution("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_StopMultipleExecutions + +```java +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.azure.resourcemanager.appcontainers.models.JobExecutionNamesCollection; +import java.util.Arrays; + +/** Samples for Jobs StopMultipleExecutions. */ +public final class JobsStopMultipleExecutionsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Stop_Multiple.json + */ + /** + * Sample code: Terminate Multiple Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void terminateMultipleContainerAppsJob( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .jobs() + .stopMultipleExecutions( + "rg", + "testcontainerAppsJob0", + new JobExecutionNamesCollection() + .withValue( + Arrays + .asList( + new JobExecutionBaseInner().withName("jobExecution-27944453"), + new JobExecutionBaseInner().withName("jobExecution-27944452"), + new JobExecutionBaseInner().withName("jobExecution-27944451"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### Jobs_Update + +```java +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.Job; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobPatchPropertiesProperties; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.TriggerType; +import com.azure.resourcemanager.appcontainers.models.Type; +import java.util.Arrays; + +/** Samples for Jobs Update. */ +public final class JobsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Patch.json + */ + /** + * Sample code: Patch Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + Job resource = + manager + .jobs() + .getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new JobPatchPropertiesProperties() + .withConfiguration( + new JobConfiguration() + .withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig() + .withReplicaCompletionCount(1) + .withParallelism(4))) + .withTemplate( + new JobTemplate() + .withInitContainers( + Arrays + .asList( + new InitContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))))) + .apply(); + } +} +``` + +### JobsExecutions_List + +```java +/** Samples for JobsExecutions List. */ +public final class JobsExecutionsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Executions_Get.json + */ + /** + * Sample code: Get a Container Apps Job Executions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAContainerAppsJobExecutions( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobsExecutions().list("rg", "testcontainerAppsJob0", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedCertificates_CreateOrUpdate + +```java +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateDomainControlValidation; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperties; + +/** Samples for ManagedCertificates CreateOrUpdate. */ +public final class ManagedCertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificate_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateCertificate( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedCertificates() + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingManagedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new ManagedCertificateProperties() + .withSubjectName("my-subject-name.company.country.net") + .withDomainControlValidation(ManagedCertificateDomainControlValidation.CNAME)) + .create(); + } +} +``` + +### ManagedCertificates_Delete + +```java +/** Samples for ManagedCertificates Delete. */ +public final class ManagedCertificatesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificate_Delete.json + */ + /** + * Sample code: Delete Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedCertificates() + .deleteWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedCertificates_Get + +```java +/** Samples for ManagedCertificates Get. */ +public final class ManagedCertificatesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificate_Get.json + */ + /** + * Sample code: Get Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedCertificates() + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedCertificates_List + +```java +/** Samples for ManagedCertificates List. */ +public final class ManagedCertificatesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificates_ListByManagedEnvironment.json + */ + /** + * Sample code: List Managed Certificates by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listManagedCertificatesByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedCertificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedCertificates_Update + +```java +import com.azure.resourcemanager.appcontainers.models.ManagedCertificate; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedCertificates Update. */ +public final class ManagedCertificatesUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificates_Patch.json + */ + /** + * Sample code: Patch Managed Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchManagedCertificate( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + ManagedCertificate resource = + manager + .managedCertificates() + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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; + } +} +``` + +### ManagedEnvironmentDiagnostics_GetDetector + +```java +/** Samples for ManagedEnvironmentDiagnostics GetDetector. */ +public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentDiagnostics_Get.json + */ + /** + * Sample code: Get diagnostic data for a managed environments. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getDiagnosticDataForAManagedEnvironments( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedEnvironmentDiagnostics() + .getDetectorWithResponse( + "mikono-workerapp-test-rg", + "mikonokubeenv", + "ManagedEnvAvailabilityMetrics", + com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedEnvironmentDiagnostics_ListDetectors + +```java +/** Samples for ManagedEnvironmentDiagnostics ListDetectors. */ +public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentDiagnostics_List.json + */ + /** + * Sample code: Get the list of available diagnostic data for a managed environments. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getTheListOfAvailableDiagnosticDataForAManagedEnvironments( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .managedEnvironmentDiagnostics() - .listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", Context.NONE); + .listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", com.azure.core.util.Context.NONE); } } ``` @@ -2150,11 +2728,7 @@ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { ```java import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import com.azure.resourcemanager.appcontainers.models.EnvironmentSkuProperties; import com.azure.resourcemanager.appcontainers.models.LogAnalyticsConfiguration; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutBoundType; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutboundSettings; -import com.azure.resourcemanager.appcontainers.models.SkuName; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.util.Arrays; @@ -2162,7 +2736,61 @@ import java.util.Arrays; /** Samples for ManagedEnvironments CreateOrUpdate. */ public final class ManagedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json + */ + /** + * Sample code: Create environment with custom infrastructureResourceGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createEnvironmentWithCustomInfrastructureResourceGroup( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withDaprAIConnectionString( + "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") + .withVnetConfiguration( + new VnetConfiguration() + .withInfrastructureSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) + .withAppLogsConfiguration( + new AppLogsConfiguration() + .withLogAnalyticsConfiguration( + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) + .withZoneRedundant(true) + .withCustomDomainConfiguration( + new CustomDomainConfiguration() + .withDnsSuffix("www.my-name.com") + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) + .withWorkloadProfiles( + Arrays + .asList( + new WorkloadProfile() + .withName("My-GP-01") + .withWorkloadProfileType("GeneralPurpose") + .withMinimumCount(3) + .withMaximumCount(12), + new WorkloadProfile() + .withName("My-MO-01") + .withWorkloadProfileType("MemoryOptimized") + .withMinimumCount(3) + .withMaximumCount(6), + new WorkloadProfile() + .withName("My-CO-01") + .withWorkloadProfileType("ComputeOptimized") + .withMinimumCount(3) + .withMaximumCount(6), + new WorkloadProfile().withName("My-consumption-01").withWorkloadProfileType("Consumption"))) + .withInfrastructureResourceGroup("myInfrastructureRgName") + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create environments. @@ -2175,40 +2803,41 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { .define("testcontainerenv") .withRegion("East US") .withExistingResourceGroup("examplerg") - .withSku(new EnvironmentSkuProperties().withName(SkuName.PREMIUM)) .withDaprAIConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") .withVnetConfiguration( new VnetConfiguration() - .withOutboundSettings( - new ManagedEnvironmentOutboundSettings() - .withOutBoundType(ManagedEnvironmentOutBoundType.USER_DEFINED_ROUTING) - .withVirtualNetworkApplianceIp("192.168.1.20"))) + .withInfrastructureSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) .withAppLogsConfiguration( new AppLogsConfiguration() .withLogAnalyticsConfiguration( - new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("string"))) + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) .withZoneRedundant(true) .withCustomDomainConfiguration( new CustomDomainConfiguration() .withDnsSuffix("www.my-name.com") - .withCertificateValue("PFX-or-PEM-blob".getBytes()) - .withCertificatePassword("private key password".getBytes())) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles( Arrays .asList( new WorkloadProfile() + .withName("My-GP-01") .withWorkloadProfileType("GeneralPurpose") .withMinimumCount(3) .withMaximumCount(12), new WorkloadProfile() + .withName("My-MO-01") .withWorkloadProfileType("MemoryOptimized") .withMinimumCount(3) .withMaximumCount(6), new WorkloadProfile() + .withName("My-CO-01") .withWorkloadProfileType("ComputeOptimized") .withMinimumCount(3) - .withMaximumCount(6))) + .withMaximumCount(6), + new WorkloadProfile().withName("My-consumption-01").withWorkloadProfileType("Consumption"))) .create(); } } @@ -2217,12 +2846,10 @@ public final class ManagedEnvironmentsCreateOrUpdateSamples { ### ManagedEnvironments_Delete ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments Delete. */ public final class ManagedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Delete.json */ /** * Sample code: Delete environment by name. @@ -2231,7 +2858,7 @@ public final class ManagedEnvironmentsDeleteSamples { */ public static void deleteEnvironmentByName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + manager.managedEnvironments().delete("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } ``` @@ -2239,12 +2866,10 @@ public final class ManagedEnvironmentsDeleteSamples { ### ManagedEnvironments_GetAuthToken ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments GetAuthToken. */ public final class ManagedEnvironmentsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_GetAuthToken.json */ /** * Sample code: Get Managed Environment Auth Token. @@ -2253,7 +2878,7 @@ public final class ManagedEnvironmentsGetAuthTokenSamples { */ public static void getManagedEnvironmentAuthToken( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().getAuthTokenWithResponse("rg", "testenv", Context.NONE); + manager.managedEnvironments().getAuthTokenWithResponse("rg", "testenv", com.azure.core.util.Context.NONE); } } ``` @@ -2261,12 +2886,10 @@ public final class ManagedEnvironmentsGetAuthTokenSamples { ### ManagedEnvironments_GetByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments GetByResourceGroup. */ public final class ManagedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -2274,7 +2897,9 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getEnvironmentsByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", Context.NONE); + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -2282,12 +2907,10 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { ### ManagedEnvironments_List ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments List. */ public final class ManagedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_ListBySubscription.json */ /** * Sample code: List environments by subscription. @@ -2296,7 +2919,7 @@ public final class ManagedEnvironmentsListSamples { */ public static void listEnvironmentsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().list(Context.NONE); + manager.managedEnvironments().list(com.azure.core.util.Context.NONE); } } ``` @@ -2304,12 +2927,10 @@ public final class ManagedEnvironmentsListSamples { ### ManagedEnvironments_ListByResourceGroup ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments ListByResourceGroup. */ public final class ManagedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json */ /** * Sample code: List environments by resource group. @@ -2318,7 +2939,7 @@ public final class ManagedEnvironmentsListByResourceGroupSamples { */ public static void listEnvironmentsByResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().listByResourceGroup("examplerg", Context.NONE); + manager.managedEnvironments().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } ``` @@ -2326,12 +2947,10 @@ public final class ManagedEnvironmentsListByResourceGroupSamples { ### ManagedEnvironments_ListWorkloadProfileStates ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments ListWorkloadProfileStates. */ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json */ /** * Sample code: List environments by subscription. @@ -2340,7 +2959,9 @@ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { */ public static void listEnvironmentsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().listWorkloadProfileStates("examplerg", "jlaw-demo1", Context.NONE); + manager + .managedEnvironments() + .listWorkloadProfileStates("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -2348,15 +2969,14 @@ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { ### ManagedEnvironments_Update ```java -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; import java.util.HashMap; import java.util.Map; /** Samples for ManagedEnvironments Update. */ public final class ManagedEnvironmentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Patch.json */ /** * Sample code: Patch Managed Environment. @@ -2365,15 +2985,12 @@ public final class ManagedEnvironmentsUpdateSamples { */ public static void patchManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager - .managedEnvironments() - .update( - "examplerg", - "testcontainerenv", - new ManagedEnvironmentInner() - .withLocation("East US") - .withTags(mapOf("tag1", "value1", "tag2", "value2")), - Context.NONE); + ManagedEnvironment resource = + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } @SuppressWarnings("unchecked") @@ -2392,12 +3009,10 @@ public final class ManagedEnvironmentsUpdateSamples { ### ManagedEnvironmentsDiagnostics_GetRoot ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsDiagnostics GetRoot. */ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -2405,7 +3020,9 @@ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getEnvironmentsByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsDiagnostics().getRootWithResponse("examplerg", "jlaw-demo1", Context.NONE); + manager + .managedEnvironmentsDiagnostics() + .getRootWithResponse("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -2420,7 +3037,7 @@ import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentStorageP /** Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json */ /** * Sample code: Create or update environments storage. @@ -2438,7 +3055,7 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { .withAzureFile( new AzureFileProperties() .withAccountName("account1") - .withAccountKey("key") + .withAccountKey("fakeTokenPlaceholder") .withAccessMode(AccessMode.READ_ONLY) .withShareName("share1"))) .create(); @@ -2449,12 +3066,10 @@ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { ### ManagedEnvironmentsStorages_Delete ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsStorages Delete. */ public final class ManagedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -2463,7 +3078,9 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + manager + .managedEnvironmentsStorages() + .deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -2471,12 +3088,10 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { ### ManagedEnvironmentsStorages_Get ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsStorages Get. */ public final class ManagedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage properties by subscription. @@ -2485,7 +3100,9 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStoragePropertiesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + manager + .managedEnvironmentsStorages() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } } ``` @@ -2493,12 +3110,10 @@ public final class ManagedEnvironmentsStoragesGetSamples { ### ManagedEnvironmentsStorages_List ```java -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsStorages List. */ public final class ManagedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -2507,7 +3122,9 @@ public final class ManagedEnvironmentsStoragesListSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + manager + .managedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } ``` @@ -2515,13 +3132,12 @@ public final class ManagedEnvironmentsStoragesListSamples { ### Namespaces_CheckNameAvailability ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; /** Samples for Namespaces CheckNameAvailability. */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificates_CheckNameAvailability.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -2538,11 +3154,11 @@ public final class NamespacesCheckNameAvailabilitySamples { new CheckNameAvailabilityRequest() .withName("testcertificatename") .withType("Microsoft.App/managedEnvironments/certificates"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_CheckNameAvailability.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_CheckNameAvailability.json */ /** * Sample code: ContainerApps_CheckNameAvailability. @@ -2557,7 +3173,7 @@ public final class NamespacesCheckNameAvailabilitySamples { "examplerg", "testcontainerenv", new CheckNameAvailabilityRequest().withName("testcappname").withType("Microsoft.App/containerApps"), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -2565,12 +3181,10 @@ public final class NamespacesCheckNameAvailabilitySamples { ### Operations_List ```java -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Operations_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Operations_List.json */ /** * Sample code: List all operations. @@ -2578,7 +3192,7 @@ public final class OperationsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listAllOperations(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml index 07acb16aab54d..f26e5f2741d48 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for ContainerAppsApi Management - This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2022-06. + This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2023-04. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java index 6af58a925aafd..3130dc077ff9c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/ContainerAppsApiManager.java @@ -39,6 +39,9 @@ import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsRevisionsImpl; import com.azure.resourcemanager.appcontainers.implementation.ContainerAppsSourceControlsImpl; import com.azure.resourcemanager.appcontainers.implementation.DaprComponentsImpl; +import com.azure.resourcemanager.appcontainers.implementation.JobsExecutionsImpl; +import com.azure.resourcemanager.appcontainers.implementation.JobsImpl; +import com.azure.resourcemanager.appcontainers.implementation.ManagedCertificatesImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentDiagnosticsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsDiagnosticsImpl; import com.azure.resourcemanager.appcontainers.implementation.ManagedEnvironmentsImpl; @@ -59,6 +62,9 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppsRevisions; import com.azure.resourcemanager.appcontainers.models.ContainerAppsSourceControls; import com.azure.resourcemanager.appcontainers.models.DaprComponents; +import com.azure.resourcemanager.appcontainers.models.Jobs; +import com.azure.resourcemanager.appcontainers.models.JobsExecutions; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificates; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentDiagnostics; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironments; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentsDiagnostics; @@ -76,14 +82,24 @@ public final class ContainerAppsApiManager { private ContainerAppsAuthConfigs containerAppsAuthConfigs; + private AvailableWorkloadProfiles availableWorkloadProfiles; + + private BillingMeters billingMeters; + + private ConnectedEnvironments connectedEnvironments; + + private ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates; + + private ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents; + + private ConnectedEnvironmentsStorages connectedEnvironmentsStorages; + private ContainerApps containerApps; private ContainerAppsRevisions containerAppsRevisions; private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; - private DaprComponents daprComponents; - private ContainerAppsDiagnostics containerAppsDiagnostics; private ManagedEnvironmentDiagnostics managedEnvironmentDiagnostics; @@ -92,28 +108,24 @@ public final class ContainerAppsApiManager { private Operations operations; + private Jobs jobs; + + private JobsExecutions jobsExecutions; + private ManagedEnvironments managedEnvironments; private Certificates certificates; + private ManagedCertificates managedCertificates; + private Namespaces namespaces; + private DaprComponents daprComponents; + private ManagedEnvironmentsStorages managedEnvironmentsStorages; private ContainerAppsSourceControls containerAppsSourceControls; - private ConnectedEnvironments connectedEnvironments; - - private ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates; - - private ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents; - - private ConnectedEnvironmentsStorages connectedEnvironmentsStorages; - - private AvailableWorkloadProfiles availableWorkloadProfiles; - - private BillingMeters billingMeters; - private final ContainerAppsApiClient clientObject; private ContainerAppsApiManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -279,7 +291,7 @@ public ContainerAppsApiManager authenticate(TokenCredential credential, AzurePro .append("-") .append("com.azure.resourcemanager.appcontainers") .append("/") - .append("1.0.0-beta.4"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -349,6 +361,83 @@ public ContainerAppsAuthConfigs containerAppsAuthConfigs() { return containerAppsAuthConfigs; } + /** + * Gets the resource collection API of AvailableWorkloadProfiles. + * + * @return Resource collection API of AvailableWorkloadProfiles. + */ + public AvailableWorkloadProfiles availableWorkloadProfiles() { + if (this.availableWorkloadProfiles == null) { + this.availableWorkloadProfiles = + new AvailableWorkloadProfilesImpl(clientObject.getAvailableWorkloadProfiles(), this); + } + return availableWorkloadProfiles; + } + + /** + * Gets the resource collection API of BillingMeters. + * + * @return Resource collection API of BillingMeters. + */ + public BillingMeters billingMeters() { + if (this.billingMeters == null) { + this.billingMeters = new BillingMetersImpl(clientObject.getBillingMeters(), this); + } + return billingMeters; + } + + /** + * Gets the resource collection API of ConnectedEnvironments. It manages ConnectedEnvironment. + * + * @return Resource collection API of ConnectedEnvironments. + */ + public ConnectedEnvironments connectedEnvironments() { + if (this.connectedEnvironments == null) { + this.connectedEnvironments = new ConnectedEnvironmentsImpl(clientObject.getConnectedEnvironments(), this); + } + return connectedEnvironments; + } + + /** + * Gets the resource collection API of ConnectedEnvironmentsCertificates. It manages Certificate. + * + * @return Resource collection API of ConnectedEnvironmentsCertificates. + */ + public ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates() { + if (this.connectedEnvironmentsCertificates == null) { + this.connectedEnvironmentsCertificates = + new ConnectedEnvironmentsCertificatesImpl(clientObject.getConnectedEnvironmentsCertificates(), this); + } + return connectedEnvironmentsCertificates; + } + + /** + * Gets the resource collection API of ConnectedEnvironmentsDaprComponents. It manages DaprComponent. + * + * @return Resource collection API of ConnectedEnvironmentsDaprComponents. + */ + public ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents() { + if (this.connectedEnvironmentsDaprComponents == null) { + this.connectedEnvironmentsDaprComponents = + new ConnectedEnvironmentsDaprComponentsImpl( + clientObject.getConnectedEnvironmentsDaprComponents(), this); + } + return connectedEnvironmentsDaprComponents; + } + + /** + * Gets the resource collection API of ConnectedEnvironmentsStorages. It manages ConnectedEnvironmentStorage. + * + * @return Resource collection API of ConnectedEnvironmentsStorages. + */ + public ConnectedEnvironmentsStorages connectedEnvironmentsStorages() { + if (this.connectedEnvironmentsStorages == null) { + this.connectedEnvironmentsStorages = + new ConnectedEnvironmentsStoragesImpl(clientObject.getConnectedEnvironmentsStorages(), this); + } + return connectedEnvironmentsStorages; + } + /** * Gets the resource collection API of ContainerApps. It manages ContainerApp. * @@ -387,18 +476,6 @@ public ContainerAppsRevisionReplicas containerAppsRevisionReplicas() { return containerAppsRevisionReplicas; } - /** - * Gets the resource collection API of DaprComponents. It manages DaprComponent. - * - * @return Resource collection API of DaprComponents. - */ - public DaprComponents daprComponents() { - if (this.daprComponents == null) { - this.daprComponents = new DaprComponentsImpl(clientObject.getDaprComponents(), this); - } - return daprComponents; - } - /** * Gets the resource collection API of ContainerAppsDiagnostics. * @@ -450,6 +527,30 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of Jobs. It manages Job. + * + * @return Resource collection API of Jobs. + */ + public Jobs jobs() { + if (this.jobs == null) { + this.jobs = new JobsImpl(clientObject.getJobs(), this); + } + return jobs; + } + + /** + * Gets the resource collection API of JobsExecutions. + * + * @return Resource collection API of JobsExecutions. + */ + public JobsExecutions jobsExecutions() { + if (this.jobsExecutions == null) { + this.jobsExecutions = new JobsExecutionsImpl(clientObject.getJobsExecutions(), this); + } + return jobsExecutions; + } + /** * Gets the resource collection API of ManagedEnvironments. It manages ManagedEnvironment. * @@ -463,7 +564,7 @@ public ManagedEnvironments managedEnvironments() { } /** - * Gets the resource collection API of Certificates. It manages Certificate. + * Gets the resource collection API of Certificates. * * @return Resource collection API of Certificates. */ @@ -474,6 +575,18 @@ public Certificates certificates() { return certificates; } + /** + * Gets the resource collection API of ManagedCertificates. It manages ManagedCertificate. + * + * @return Resource collection API of ManagedCertificates. + */ + public ManagedCertificates managedCertificates() { + if (this.managedCertificates == null) { + this.managedCertificates = new ManagedCertificatesImpl(clientObject.getManagedCertificates(), this); + } + return managedCertificates; + } + /** * Gets the resource collection API of Namespaces. * @@ -486,6 +599,18 @@ public Namespaces namespaces() { return namespaces; } + /** + * Gets the resource collection API of DaprComponents. + * + * @return Resource collection API of DaprComponents. + */ + public DaprComponents daprComponents() { + if (this.daprComponents == null) { + this.daprComponents = new DaprComponentsImpl(clientObject.getDaprComponents(), this); + } + return daprComponents; + } + /** * Gets the resource collection API of ManagedEnvironmentsStorages. It manages ManagedEnvironmentStorage. * @@ -512,83 +637,6 @@ public ContainerAppsSourceControls containerAppsSourceControls() { return containerAppsSourceControls; } - /** - * Gets the resource collection API of ConnectedEnvironments. It manages ConnectedEnvironment. - * - * @return Resource collection API of ConnectedEnvironments. - */ - public ConnectedEnvironments connectedEnvironments() { - if (this.connectedEnvironments == null) { - this.connectedEnvironments = new ConnectedEnvironmentsImpl(clientObject.getConnectedEnvironments(), this); - } - return connectedEnvironments; - } - - /** - * Gets the resource collection API of ConnectedEnvironmentsCertificates. - * - * @return Resource collection API of ConnectedEnvironmentsCertificates. - */ - public ConnectedEnvironmentsCertificates connectedEnvironmentsCertificates() { - if (this.connectedEnvironmentsCertificates == null) { - this.connectedEnvironmentsCertificates = - new ConnectedEnvironmentsCertificatesImpl(clientObject.getConnectedEnvironmentsCertificates(), this); - } - return connectedEnvironmentsCertificates; - } - - /** - * Gets the resource collection API of ConnectedEnvironmentsDaprComponents. - * - * @return Resource collection API of ConnectedEnvironmentsDaprComponents. - */ - public ConnectedEnvironmentsDaprComponents connectedEnvironmentsDaprComponents() { - if (this.connectedEnvironmentsDaprComponents == null) { - this.connectedEnvironmentsDaprComponents = - new ConnectedEnvironmentsDaprComponentsImpl( - clientObject.getConnectedEnvironmentsDaprComponents(), this); - } - return connectedEnvironmentsDaprComponents; - } - - /** - * Gets the resource collection API of ConnectedEnvironmentsStorages. It manages ConnectedEnvironmentStorage. - * - * @return Resource collection API of ConnectedEnvironmentsStorages. - */ - public ConnectedEnvironmentsStorages connectedEnvironmentsStorages() { - if (this.connectedEnvironmentsStorages == null) { - this.connectedEnvironmentsStorages = - new ConnectedEnvironmentsStoragesImpl(clientObject.getConnectedEnvironmentsStorages(), this); - } - return connectedEnvironmentsStorages; - } - - /** - * Gets the resource collection API of AvailableWorkloadProfiles. - * - * @return Resource collection API of AvailableWorkloadProfiles. - */ - public AvailableWorkloadProfiles availableWorkloadProfiles() { - if (this.availableWorkloadProfiles == null) { - this.availableWorkloadProfiles = - new AvailableWorkloadProfilesImpl(clientObject.getAvailableWorkloadProfiles(), this); - } - return availableWorkloadProfiles; - } - - /** - * Gets the resource collection API of BillingMeters. - * - * @return Resource collection API of BillingMeters. - */ - public BillingMeters billingMeters() { - if (this.billingMeters == null) { - this.billingMeters = new BillingMetersImpl(clientObject.getBillingMeters(), this); - } - return billingMeters; - } - /** * @return Wrapped service client ContainerAppsApiClient providing direct access to the underlying auto-generated * API implementation, based on Azure REST API. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java index b7f2855529f33..44711ea9f69ab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsApiClient.java @@ -51,6 +51,48 @@ public interface ContainerAppsApiClient { */ ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs(); + /** + * Gets the AvailableWorkloadProfilesClient object to access its operations. + * + * @return the AvailableWorkloadProfilesClient object. + */ + AvailableWorkloadProfilesClient getAvailableWorkloadProfiles(); + + /** + * Gets the BillingMetersClient object to access its operations. + * + * @return the BillingMetersClient object. + */ + BillingMetersClient getBillingMeters(); + + /** + * Gets the ConnectedEnvironmentsClient object to access its operations. + * + * @return the ConnectedEnvironmentsClient object. + */ + ConnectedEnvironmentsClient getConnectedEnvironments(); + + /** + * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * + * @return the ConnectedEnvironmentsCertificatesClient object. + */ + ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates(); + + /** + * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. + * + * @return the ConnectedEnvironmentsDaprComponentsClient object. + */ + ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents(); + + /** + * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * + * @return the ConnectedEnvironmentsStoragesClient object. + */ + ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages(); + /** * Gets the ContainerAppsClient object to access its operations. * @@ -72,13 +114,6 @@ public interface ContainerAppsApiClient { */ ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas(); - /** - * Gets the DaprComponentsClient object to access its operations. - * - * @return the DaprComponentsClient object. - */ - DaprComponentsClient getDaprComponents(); - /** * Gets the ContainerAppsDiagnosticsClient object to access its operations. * @@ -108,79 +143,65 @@ public interface ContainerAppsApiClient { OperationsClient getOperations(); /** - * Gets the ManagedEnvironmentsClient object to access its operations. - * - * @return the ManagedEnvironmentsClient object. - */ - ManagedEnvironmentsClient getManagedEnvironments(); - - /** - * Gets the CertificatesClient object to access its operations. + * Gets the JobsClient object to access its operations. * - * @return the CertificatesClient object. + * @return the JobsClient object. */ - CertificatesClient getCertificates(); + JobsClient getJobs(); /** - * Gets the NamespacesClient object to access its operations. + * Gets the JobsExecutionsClient object to access its operations. * - * @return the NamespacesClient object. + * @return the JobsExecutionsClient object. */ - NamespacesClient getNamespaces(); + JobsExecutionsClient getJobsExecutions(); /** - * Gets the ManagedEnvironmentsStoragesClient object to access its operations. - * - * @return the ManagedEnvironmentsStoragesClient object. - */ - ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); - - /** - * Gets the ContainerAppsSourceControlsClient object to access its operations. + * Gets the ManagedEnvironmentsClient object to access its operations. * - * @return the ContainerAppsSourceControlsClient object. + * @return the ManagedEnvironmentsClient object. */ - ContainerAppsSourceControlsClient getContainerAppsSourceControls(); + ManagedEnvironmentsClient getManagedEnvironments(); /** - * Gets the ConnectedEnvironmentsClient object to access its operations. + * Gets the CertificatesClient object to access its operations. * - * @return the ConnectedEnvironmentsClient object. + * @return the CertificatesClient object. */ - ConnectedEnvironmentsClient getConnectedEnvironments(); + CertificatesClient getCertificates(); /** - * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * Gets the ManagedCertificatesClient object to access its operations. * - * @return the ConnectedEnvironmentsCertificatesClient object. + * @return the ManagedCertificatesClient object. */ - ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates(); + ManagedCertificatesClient getManagedCertificates(); /** - * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. + * Gets the NamespacesClient object to access its operations. * - * @return the ConnectedEnvironmentsDaprComponentsClient object. + * @return the NamespacesClient object. */ - ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents(); + NamespacesClient getNamespaces(); /** - * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * Gets the DaprComponentsClient object to access its operations. * - * @return the ConnectedEnvironmentsStoragesClient object. + * @return the DaprComponentsClient object. */ - ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages(); + DaprComponentsClient getDaprComponents(); /** - * Gets the AvailableWorkloadProfilesClient object to access its operations. + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. * - * @return the AvailableWorkloadProfilesClient object. + * @return the ManagedEnvironmentsStoragesClient object. */ - AvailableWorkloadProfilesClient getAvailableWorkloadProfiles(); + ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); /** - * Gets the BillingMetersClient object to access its operations. + * Gets the ContainerAppsSourceControlsClient object to access its operations. * - * @return the BillingMetersClient object. + * @return the ContainerAppsSourceControlsClient object. */ - BillingMetersClient getBillingMeters(); + ContainerAppsSourceControlsClient getContainerAppsSourceControls(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java index bf77072df0afd..ebedd1eb1be57 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsClient.java @@ -76,7 +76,10 @@ public interface ContainerAppsClient { * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -90,7 +93,10 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App. */ @@ -231,10 +237,10 @@ ContainerAppInner createOrUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUpdate( + SyncPoller, ContainerAppInner> beginUpdate( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); /** @@ -250,10 +256,10 @@ SyncPoller, Void> beginUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUpdate( + SyncPoller, ContainerAppInner> beginUpdate( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context); /** @@ -268,9 +274,10 @@ SyncPoller, Void> beginUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); + ContainerAppInner update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); /** * Update properties of a Container App @@ -285,9 +292,10 @@ SyncPoller, Void> beginUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update( + ContainerAppInner update( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context); /** @@ -358,7 +366,10 @@ Response listSecretsWithResponse( * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app along with {@link Response}. */ @@ -372,7 +383,10 @@ Response getAuthTokenWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java index 661c67a8b56ec..ed4321095d887 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ContainerAppsDiagnosticsClient.java @@ -146,7 +146,10 @@ Response getRevisionWithResponse( * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -159,7 +162,10 @@ Response getRevisionWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java new file mode 100644 index 0000000000000..5ca3298761c48 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsClient.java @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.models.ContainerAppJobExecutionsInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; +import com.azure.resourcemanager.appcontainers.models.JobExecutionNamesCollection; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import com.azure.resourcemanager.appcontainers.models.JobPatchProperties; + +/** An instance of this class provides access to all the operations defined in JobsClient. */ +public interface JobsClient { + /** + * Get the Container Apps Jobs in a given subscription. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context); + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner getByResourceGroup(String resourceGroupName, String jobName); + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginCreateOrUpdate( + String resourceGroupName, String jobName, JobInner jobEnvelope); + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginCreateOrUpdate( + String resourceGroupName, String jobName, JobInner jobEnvelope, Context context); + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope); + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope, Context context); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String jobName); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 jobName); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 jobName, Context context); + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginUpdate( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope); + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobInner> beginUpdate( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context); + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope); + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context); + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobExecutionBaseInner> beginStart( + String resourceGroupName, String jobName, JobExecutionTemplate template); + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, JobExecutionBaseInner> beginStart( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context); + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobExecutionBaseInner start(String resourceGroupName, String jobName, JobExecutionTemplate template); + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobExecutionBaseInner start( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopExecution( + String resourceGroupName, String jobName, String jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStopExecution( + String resourceGroupName, String jobName, String jobExecutionName, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 stopExecution(String resourceGroupName, String jobName, String jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 stopExecution(String resourceGroupName, String jobName, String jobExecutionName, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppJobExecutionsInner> beginStopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppJobExecutionsInner> beginStopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppJobExecutionsInner stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppJobExecutionsInner stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context); + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse( + String resourceGroupName, String jobName, Context context); + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.java new file mode 100644 index 0000000000000..7b5284f29e51d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/JobsExecutionsClient.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.appcontainers.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.appcontainers.fluent.models.JobExecutionInner; + +/** An instance of this class provides access to all the operations defined in JobsExecutionsClient. */ +public interface JobsExecutionsClient { + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String jobName); + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String jobName, String filter, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedCertificatesClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedCertificatesClient.java new file mode 100644 index 0000000000000..30113c809f0dc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedCertificatesClient.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.appcontainers.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.appcontainers.fluent.models.ManagedCertificateInner; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificatePatch; + +/** An instance of this class provides access to all the operations defined in ManagedCertificatesClient. */ +public interface ManagedCertificatesClient { + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context); + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCertificateInner get(String resourceGroupName, String environmentName, String managedCertificateName); + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedCertificateInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String managedCertificateName); + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedCertificateInner> beginCreateOrUpdate( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context); + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCertificateInner createOrUpdate( + String resourceGroupName, String environmentName, String managedCertificateName); + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCertificateInner createOrUpdate( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context); + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context); + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if 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 environmentName, String managedCertificateName); + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope, + Context context); + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedCertificateInner update( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope); + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String environmentName, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java index 12bb72b96036c..9631d1323e226 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/ManagedEnvironmentsClient.java @@ -260,10 +260,10 @@ ManagedEnvironmentInner createOrUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUpdate( + SyncPoller, ManagedEnvironmentInner> beginUpdate( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); /** @@ -279,10 +279,10 @@ SyncPoller, Void> beginUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginUpdate( + SyncPoller, ManagedEnvironmentInner> beginUpdate( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); /** @@ -297,9 +297,11 @@ SyncPoller, Void> beginUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); + ManagedEnvironmentInner update( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); /** * Update Managed Environment's properties. @@ -314,9 +316,10 @@ SyncPoller, Void> beginUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - void update( + ManagedEnvironmentInner update( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); /** @@ -354,9 +357,9 @@ Response getAuthTokenWithResponse( EnvironmentAuthTokenInner getAuthToken(String resourceGroupName, String environmentName); /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -364,17 +367,16 @@ Response getAuthTokenWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedIterable}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listWorkloadProfileStates( String resourceGroupName, String environmentName); /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -383,8 +385,7 @@ PagedIterable listWorkloadProfileStates( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedIterable}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listWorkloadProfileStates( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java index 1982f7c7dde0f..29bba9a507794 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/AvailableWorkloadProfileInner.java @@ -10,7 +10,7 @@ import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** A premium workload profile. */ +/** A workload profile with specific hardware configure to run container apps. */ @Fluent public final class AvailableWorkloadProfileInner extends ProxyResource { /* diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java index 236f663470d61..a6bb8d5efcdcc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/BillingMeterCollectionInner.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Collection of premium workload billing meters. */ +/** Collection of billing meters. */ @Fluent public final class BillingMeterCollectionInner { /* diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java index 0f37c337d0552..aa0e8dae7598f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppInner.java @@ -32,6 +32,14 @@ public final class ContainerAppInner extends Resource { @JsonProperty(value = "identity") private ManagedServiceIdentity identity; + /* + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is + * managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if + * it is removed from the template since it is managed by another resource. + */ + @JsonProperty(value = "managedBy") + private String managedBy; + /* * ContainerApp resource specific properties */ @@ -90,6 +98,30 @@ public ContainerAppInner withIdentity(ManagedServiceIdentity identity) { return this; } + /** + * Get the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Set the managedBy property: The fully qualified resource ID of the resource that manages this resource. Indicates + * if this resource is managed by another Azure resource. If this is present, complete mode deployment will not + * delete the resource if it is removed from the template since it is managed by another resource. + * + * @param managedBy the managedBy value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withManagedBy(String managedBy) { + this.managedBy = managedBy; + return this; + } + /** * Get the innerProperties property: ContainerApp resource specific properties. * @@ -178,25 +210,25 @@ public ContainerAppInner withEnvironmentId(String environmentId) { } /** - * Get the workloadProfileType property: Workload profile type to pin for container app execution. + * Get the workloadProfileName property: Workload profile name to pin for container app execution. * - * @return the workloadProfileType value. + * @return the workloadProfileName value. */ - public String workloadProfileType() { - return this.innerProperties() == null ? null : this.innerProperties().workloadProfileType(); + public String workloadProfileName() { + return this.innerProperties() == null ? null : this.innerProperties().workloadProfileName(); } /** - * Set the workloadProfileType property: Workload profile type to pin for container app execution. + * Set the workloadProfileName property: Workload profile name to pin for container app execution. * - * @param workloadProfileType the workloadProfileType value to set. + * @param workloadProfileName the workloadProfileName value to set. * @return the ContainerAppInner object itself. */ - public ContainerAppInner withWorkloadProfileType(String workloadProfileType) { + public ContainerAppInner withWorkloadProfileName(String workloadProfileName) { if (this.innerProperties() == null) { this.innerProperties = new ContainerAppProperties(); } - this.innerProperties().withWorkloadProfileType(workloadProfileType); + this.innerProperties().withWorkloadProfileName(workloadProfileName); return this; } @@ -209,6 +241,15 @@ public String latestRevisionName() { return this.innerProperties() == null ? null : this.innerProperties().latestRevisionName(); } + /** + * Get the latestReadyRevisionName property: Name of the latest ready revision of the Container App. + * + * @return the latestReadyRevisionName value. + */ + public String latestReadyRevisionName() { + return this.innerProperties() == null ? null : this.innerProperties().latestReadyRevisionName(); + } + /** * Get the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.java new file mode 100644 index 0000000000000..80a392e0d7c78 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppJobExecutionsInner.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App executions collection ARM resource. */ +@Fluent +public final class ContainerAppJobExecutionsInner { + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ContainerAppJobExecutionsInner class. */ + public ContainerAppJobExecutionsInner() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the ContainerAppJobExecutionsInner object itself. + */ + public ContainerAppJobExecutionsInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ContainerAppJobExecutionsInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ContainerAppJobExecutionsInner.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java index b4f8ae444a422..1429f8f7e5f4c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ContainerAppProperties.java @@ -33,10 +33,10 @@ public final class ContainerAppProperties { private String environmentId; /* - * Workload profile type to pin for container app execution. + * Workload profile name to pin for container app execution. */ - @JsonProperty(value = "workloadProfileType") - private String workloadProfileType; + @JsonProperty(value = "workloadProfileName") + private String workloadProfileName; /* * Name of the latest revision of the Container App. @@ -44,6 +44,12 @@ public final class ContainerAppProperties { @JsonProperty(value = "latestRevisionName", access = JsonProperty.Access.WRITE_ONLY) private String latestRevisionName; + /* + * Name of the latest ready revision of the Container App. + */ + @JsonProperty(value = "latestReadyRevisionName", access = JsonProperty.Access.WRITE_ONLY) + private String latestReadyRevisionName; + /* * Fully Qualified Domain Name of the latest revision of the Container App. */ @@ -134,22 +140,22 @@ public ContainerAppProperties withEnvironmentId(String environmentId) { } /** - * Get the workloadProfileType property: Workload profile type to pin for container app execution. + * Get the workloadProfileName property: Workload profile name to pin for container app execution. * - * @return the workloadProfileType value. + * @return the workloadProfileName value. */ - public String workloadProfileType() { - return this.workloadProfileType; + public String workloadProfileName() { + return this.workloadProfileName; } /** - * Set the workloadProfileType property: Workload profile type to pin for container app execution. + * Set the workloadProfileName property: Workload profile name to pin for container app execution. * - * @param workloadProfileType the workloadProfileType value to set. + * @param workloadProfileName the workloadProfileName value to set. * @return the ContainerAppProperties object itself. */ - public ContainerAppProperties withWorkloadProfileType(String workloadProfileType) { - this.workloadProfileType = workloadProfileType; + public ContainerAppProperties withWorkloadProfileName(String workloadProfileName) { + this.workloadProfileName = workloadProfileName; return this; } @@ -162,6 +168,15 @@ public String latestRevisionName() { return this.latestRevisionName; } + /** + * Get the latestReadyRevisionName property: Name of the latest ready revision of the Container App. + * + * @return the latestReadyRevisionName value. + */ + public String latestReadyRevisionName() { + return this.latestReadyRevisionName; + } + /** * Get the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java index 340ba9e1b5acc..72cdffb688012 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/DaprSecretsCollectionInner.java @@ -6,7 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.appcontainers.models.Secret; +import com.azure.resourcemanager.appcontainers.models.DaprSecret; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,7 +17,7 @@ public final class DaprSecretsCollectionInner { * Collection of secrets used by a Dapr component */ @JsonProperty(value = "value", required = true) - private List value; + private List value; /** Creates an instance of DaprSecretsCollectionInner class. */ public DaprSecretsCollectionInner() { @@ -28,7 +28,7 @@ public DaprSecretsCollectionInner() { * * @return the value value. */ - public List value() { + public List value() { return this.value; } @@ -38,7 +38,7 @@ public List value() { * @param value the value value to set. * @return the DaprSecretsCollectionInner object itself. */ - public DaprSecretsCollectionInner withValue(List value) { + public DaprSecretsCollectionInner withValue(List value) { this.value = value; return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.java new file mode 100644 index 0000000000000..e8415f46c8706 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionBaseInner.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App's Job execution name. */ +@Fluent +public final class JobExecutionBaseInner { + /* + * Job execution name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Job execution Id. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of JobExecutionBaseInner class. */ + public JobExecutionBaseInner() { + } + + /** + * Get the name property: Job execution name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Job execution name. + * + * @param name the name value to set. + * @return the JobExecutionBaseInner object itself. + */ + public JobExecutionBaseInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Job execution Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Job execution Id. + * + * @param id the id value to set. + * @return the JobExecutionBaseInner object itself. + */ + public JobExecutionBaseInner 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.java new file mode 100644 index 0000000000000..116681ecc04d4 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobExecutionInner.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Container Apps Jobs execution. */ +@Fluent +public final class JobExecutionInner { + /* + * Job execution Name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Job execution Id. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Job Type. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Current running State of the job + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private JobExecutionRunningState status; + + /* + * Job execution start time. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Job execution start time. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Job's execution container. + */ + @JsonProperty(value = "template") + private JobExecutionTemplate template; + + /** Creates an instance of JobExecutionInner class. */ + public JobExecutionInner() { + } + + /** + * Get the name property: Job execution Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Job execution Name. + * + * @param name the name value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Job execution Id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Job execution Id. + * + * @param id the id value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type property: Job Type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Job Type. + * + * @param type the type value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the status property: Current running State of the job. + * + * @return the status value. + */ + public JobExecutionRunningState status() { + return this.status; + } + + /** + * Get the startTime property: Job execution start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Job execution start time. + * + * @param startTime the startTime value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Job execution start time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Job execution start time. + * + * @param endTime the endTime value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the template property: Job's execution container. + * + * @return the template value. + */ + public JobExecutionTemplate template() { + return this.template; + } + + /** + * Set the template property: Job's execution container. + * + * @param template the template value to set. + * @return the JobExecutionInner object itself. + */ + public JobExecutionInner withTemplate(JobExecutionTemplate template) { + this.template = template; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (template() != null) { + template().validate(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java new file mode 100644 index 0000000000000..c8aa364ef3f42 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobInner.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App Job. */ +@Fluent +public final class JobInner extends Resource { + /* + * Managed identities needed by a container app job to interact with other Azure services to not maintain any + * secrets or credentials in code. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Container Apps Job resource specific properties. + */ + @JsonProperty(value = "properties") + private JobProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of JobInner class. */ + public JobInner() { + } + + /** + * Get the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. + * + * @param identity the identity value to set. + * @return the JobInner object itself. + */ + public JobInner withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: Container Apps Job resource specific properties. + * + * @return the innerProperties value. + */ + private JobProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public JobInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public JobInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Container Apps Job. + * + * @return the provisioningState value. + */ + public JobProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the environmentId property: Resource ID of environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.innerProperties() == null ? null : this.innerProperties().environmentId(); + } + + /** + * Set the environmentId property: Resource ID of environment. + * + * @param environmentId the environmentId value to set. + * @return the JobInner object itself. + */ + public JobInner withEnvironmentId(String environmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withEnvironmentId(environmentId); + return this; + } + + /** + * Get the workloadProfileName property: Workload profile name to pin for container apps job execution. + * + * @return the workloadProfileName value. + */ + public String workloadProfileName() { + return this.innerProperties() == null ? null : this.innerProperties().workloadProfileName(); + } + + /** + * Set the workloadProfileName property: Workload profile name to pin for container apps job execution. + * + * @param workloadProfileName the workloadProfileName value to set. + * @return the JobInner object itself. + */ + public JobInner withWorkloadProfileName(String workloadProfileName) { + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withWorkloadProfileName(workloadProfileName); + return this; + } + + /** + * Get the configuration property: Container Apps Job configuration properties. + * + * @return the configuration value. + */ + public JobConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: Container Apps Job configuration properties. + * + * @param configuration the configuration value to set. + * @return the JobInner object itself. + */ + public JobInner withConfiguration(JobConfiguration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the template property: Container Apps job definition. + * + * @return the template value. + */ + public JobTemplate template() { + return this.innerProperties() == null ? null : this.innerProperties().template(); + } + + /** + * Set the template property: Container Apps job definition. + * + * @param template the template value to set. + * @return the JobInner object itself. + */ + public JobInner withTemplate(JobTemplate template) { + if (this.innerProperties() == null) { + this.innerProperties = new JobProperties(); + } + this.innerProperties().withTemplate(template); + return this; + } + + /** + * Get the outboundIpAddresses property: Outbound IP Addresses of a container apps job. + * + * @return the outboundIpAddresses value. + */ + public List outboundIpAddresses() { + return this.innerProperties() == null ? null : this.innerProperties().outboundIpAddresses(); + } + + /** + * Get the eventStreamEndpoint property: The endpoint of the eventstream of the container apps job. + * + * @return the eventStreamEndpoint value. + */ + public String eventStreamEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().eventStreamEndpoint(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.java new file mode 100644 index 0000000000000..7787e3d8147b6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobProperties.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container Apps Job resource specific properties. */ +@Fluent +public final class JobProperties { + /* + * Provisioning state of the Container Apps Job. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private JobProvisioningState provisioningState; + + /* + * Resource ID of environment. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * Workload profile name to pin for container apps job execution. + */ + @JsonProperty(value = "workloadProfileName") + private String workloadProfileName; + + /* + * Container Apps Job configuration properties. + */ + @JsonProperty(value = "configuration") + private JobConfiguration configuration; + + /* + * Container Apps job definition. + */ + @JsonProperty(value = "template") + private JobTemplate template; + + /* + * Outbound IP Addresses of a container apps job. + */ + @JsonProperty(value = "outboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY) + private List outboundIpAddresses; + + /* + * The endpoint of the eventstream of the container apps job. + */ + @JsonProperty(value = "eventStreamEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String eventStreamEndpoint; + + /** Creates an instance of JobProperties class. */ + public JobProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the Container Apps Job. + * + * @return the provisioningState value. + */ + public JobProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the environmentId property: Resource ID of environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Resource ID of environment. + * + * @param environmentId the environmentId value to set. + * @return the JobProperties object itself. + */ + public JobProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the workloadProfileName property: Workload profile name to pin for container apps job execution. + * + * @return the workloadProfileName value. + */ + public String workloadProfileName() { + return this.workloadProfileName; + } + + /** + * Set the workloadProfileName property: Workload profile name to pin for container apps job execution. + * + * @param workloadProfileName the workloadProfileName value to set. + * @return the JobProperties object itself. + */ + public JobProperties withWorkloadProfileName(String workloadProfileName) { + this.workloadProfileName = workloadProfileName; + return this; + } + + /** + * Get the configuration property: Container Apps Job configuration properties. + * + * @return the configuration value. + */ + public JobConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Container Apps Job configuration properties. + * + * @param configuration the configuration value to set. + * @return the JobProperties object itself. + */ + public JobProperties withConfiguration(JobConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the template property: Container Apps job definition. + * + * @return the template value. + */ + public JobTemplate template() { + return this.template; + } + + /** + * Set the template property: Container Apps job definition. + * + * @param template the template value to set. + * @return the JobProperties object itself. + */ + public JobProperties withTemplate(JobTemplate template) { + this.template = template; + return this; + } + + /** + * Get the outboundIpAddresses property: Outbound IP Addresses of a container apps job. + * + * @return the outboundIpAddresses value. + */ + public List outboundIpAddresses() { + return this.outboundIpAddresses; + } + + /** + * Get the eventStreamEndpoint property: The endpoint of the eventstream of the container apps job. + * + * @return the eventStreamEndpoint value. + */ + public String eventStreamEndpoint() { + return this.eventStreamEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + if (template() != null) { + template().validate(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java new file mode 100644 index 0000000000000..64d659c402ceb --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/JobSecretsCollectionInner.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.models.Secret; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container Apps Job Secrets Collection ARM resource. */ +@Fluent +public final class JobSecretsCollectionInner { + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** Creates an instance of JobSecretsCollectionInner class. */ + public JobSecretsCollectionInner() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the JobSecretsCollectionInner object itself. + */ + public JobSecretsCollectionInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model JobSecretsCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobSecretsCollectionInner.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.java new file mode 100644 index 0000000000000..4854ffb18f62f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedCertificateInner.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.appcontainers.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. */ +@Fluent +public final class ManagedCertificateInner extends Resource { + /* + * Certificate resource specific properties + */ + @JsonProperty(value = "properties") + private ManagedCertificateProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ManagedCertificateInner class. */ + public ManagedCertificateInner() { + } + + /** + * Get the properties property: Certificate resource specific properties. + * + * @return the properties value. + */ + public ManagedCertificateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Certificate resource specific properties. + * + * @param properties the properties value to set. + * @return the ManagedCertificateInner object itself. + */ + public ManagedCertificateInner withProperties(ManagedCertificateProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public ManagedCertificateInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedCertificateInner 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(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java index a75d12a08e155..f3c137f21723b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentInner.java @@ -9,8 +9,9 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; -import com.azure.resourcemanager.appcontainers.models.EnvironmentSkuProperties; +import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import com.fasterxml.jackson.annotation.JsonProperty; @@ -21,10 +22,10 @@ @Fluent public final class ManagedEnvironmentInner extends Resource { /* - * SKU properties of the Environment. + * Kind of the Environment. */ - @JsonProperty(value = "sku") - private EnvironmentSkuProperties sku; + @JsonProperty(value = "kind") + private String kind; /* * Managed environment resource specific properties @@ -43,22 +44,22 @@ public ManagedEnvironmentInner() { } /** - * Get the sku property: SKU properties of the Environment. + * Get the kind property: Kind of the Environment. * - * @return the sku value. + * @return the kind value. */ - public EnvironmentSkuProperties sku() { - return this.sku; + public String kind() { + return this.kind; } /** - * Set the sku property: SKU properties of the Environment. + * Set the kind property: Kind of the Environment. * - * @param sku the sku value to set. + * @param kind the kind value to set. * @return the ManagedEnvironmentInner object itself. */ - public ManagedEnvironmentInner withSku(EnvironmentSkuProperties sku) { - this.sku = sku; + public ManagedEnvironmentInner withKind(String kind) { + this.kind = kind; return this; } @@ -306,15 +307,85 @@ public ManagedEnvironmentInner withWorkloadProfiles(List worklo return this; } + /** + * Get the kedaConfiguration property: The configuration of Keda component. + * + * @return the kedaConfiguration value. + */ + public KedaConfiguration kedaConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().kedaConfiguration(); + } + + /** + * Set the kedaConfiguration property: The configuration of Keda component. + * + * @param kedaConfiguration the kedaConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withKedaConfiguration(KedaConfiguration kedaConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withKedaConfiguration(kedaConfiguration); + return this; + } + + /** + * Get the daprConfiguration property: The configuration of Dapr component. + * + * @return the daprConfiguration value. + */ + public DaprConfiguration daprConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().daprConfiguration(); + } + + /** + * Set the daprConfiguration property: The configuration of Dapr component. + * + * @param daprConfiguration the daprConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withDaprConfiguration(DaprConfiguration daprConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withDaprConfiguration(daprConfiguration); + return this; + } + + /** + * Get the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. + * + * @return the infrastructureResourceGroup value. + */ + public String infrastructureResourceGroup() { + return this.innerProperties() == null ? null : this.innerProperties().infrastructureResourceGroup(); + } + + /** + * Set the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. + * + * @param infrastructureResourceGroup the infrastructureResourceGroup value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withInfrastructureResourceGroup(String infrastructureResourceGroup) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withInfrastructureResourceGroup(infrastructureResourceGroup); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sku() != null) { - sku().validate(); - } if (innerProperties() != null) { innerProperties().validate(); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java index 78ef578717a04..d36af4c8d7aea 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ManagedEnvironmentProperties.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import com.fasterxml.jackson.annotation.JsonProperty; @@ -90,6 +92,26 @@ public final class ManagedEnvironmentProperties { @JsonProperty(value = "workloadProfiles") private List workloadProfiles; + /* + * The configuration of Keda component. + */ + @JsonProperty(value = "kedaConfiguration") + private KedaConfiguration kedaConfiguration; + + /* + * The configuration of Dapr component. + */ + @JsonProperty(value = "daprConfiguration") + private DaprConfiguration daprConfiguration; + + /* + * Name of the platform-managed resource group created for the Managed Environment to host infrastructure + * resources. If a subnet ID is provided, this resource group will be created in the same subscription as the + * subnet. + */ + @JsonProperty(value = "infrastructureResourceGroup") + private String infrastructureResourceGroup; + /** Creates an instance of ManagedEnvironmentProperties class. */ public ManagedEnvironmentProperties() { } @@ -286,6 +308,70 @@ public ManagedEnvironmentProperties withWorkloadProfiles(List w return this; } + /** + * Get the kedaConfiguration property: The configuration of Keda component. + * + * @return the kedaConfiguration value. + */ + public KedaConfiguration kedaConfiguration() { + return this.kedaConfiguration; + } + + /** + * Set the kedaConfiguration property: The configuration of Keda component. + * + * @param kedaConfiguration the kedaConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withKedaConfiguration(KedaConfiguration kedaConfiguration) { + this.kedaConfiguration = kedaConfiguration; + return this; + } + + /** + * Get the daprConfiguration property: The configuration of Dapr component. + * + * @return the daprConfiguration value. + */ + public DaprConfiguration daprConfiguration() { + return this.daprConfiguration; + } + + /** + * Set the daprConfiguration property: The configuration of Dapr component. + * + * @param daprConfiguration the daprConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withDaprConfiguration(DaprConfiguration daprConfiguration) { + this.daprConfiguration = daprConfiguration; + return this; + } + + /** + * Get the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. + * + * @return the infrastructureResourceGroup value. + */ + public String infrastructureResourceGroup() { + return this.infrastructureResourceGroup; + } + + /** + * Set the infrastructureResourceGroup property: Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in + * the same subscription as the subnet. + * + * @param infrastructureResourceGroup the infrastructureResourceGroup value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withInfrastructureResourceGroup(String infrastructureResourceGroup) { + this.infrastructureResourceGroup = infrastructureResourceGroup; + return this; + } + /** * Validates the instance. * @@ -304,5 +390,11 @@ public void validate() { if (workloadProfiles() != null) { workloadProfiles().forEach(e -> e.validate()); } + if (kedaConfiguration() != null) { + kedaConfiguration().validate(); + } + if (daprConfiguration() != null) { + daprConfiguration().validate(); + } } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java index 5dfd654823430..4238788b5f097 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.resourcemanager.appcontainers.models.ContainerAppReplicaRunningState; import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -58,6 +59,24 @@ public OffsetDateTime createdTime() { return this.innerProperties() == null ? null : this.innerProperties().createdTime(); } + /** + * Get the runningState property: Current running state of the replica. + * + * @return the runningState value. + */ + public ContainerAppReplicaRunningState runningState() { + return this.innerProperties() == null ? null : this.innerProperties().runningState(); + } + + /** + * Get the runningStateDetails property: The details of replica current running state. + * + * @return the runningStateDetails value. + */ + public String runningStateDetails() { + return this.innerProperties() == null ? null : this.innerProperties().runningStateDetails(); + } + /** * Get the containers property: The containers collection under a replica. * @@ -81,6 +100,29 @@ public ReplicaInner withContainers(List containers) { return this; } + /** + * Get the initContainers property: The init containers collection under a replica. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.innerProperties() == null ? null : this.innerProperties().initContainers(); + } + + /** + * Set the initContainers property: The init containers collection under a replica. + * + * @param initContainers the initContainers value to set. + * @return the ReplicaInner object itself. + */ + public ReplicaInner withInitContainers(List initContainers) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicaProperties(); + } + this.innerProperties().withInitContainers(initContainers); + return this; + } + /** * Validates the instance. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java index 1ddc5027cdc99..0d3eed1784a79 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/ReplicaProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appcontainers.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.appcontainers.models.ContainerAppReplicaRunningState; import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -19,12 +20,30 @@ public final class ReplicaProperties { @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime createdTime; + /* + * Current running state of the replica + */ + @JsonProperty(value = "runningState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerAppReplicaRunningState runningState; + + /* + * The details of replica current running state + */ + @JsonProperty(value = "runningStateDetails", access = JsonProperty.Access.WRITE_ONLY) + private String runningStateDetails; + /* * The containers collection under a replica. */ @JsonProperty(value = "containers") private List containers; + /* + * The init containers collection under a replica. + */ + @JsonProperty(value = "initContainers") + private List initContainers; + /** Creates an instance of ReplicaProperties class. */ public ReplicaProperties() { } @@ -38,6 +57,24 @@ public OffsetDateTime createdTime() { return this.createdTime; } + /** + * Get the runningState property: Current running state of the replica. + * + * @return the runningState value. + */ + public ContainerAppReplicaRunningState runningState() { + return this.runningState; + } + + /** + * Get the runningStateDetails property: The details of replica current running state. + * + * @return the runningStateDetails value. + */ + public String runningStateDetails() { + return this.runningStateDetails; + } + /** * Get the containers property: The containers collection under a replica. * @@ -58,6 +95,26 @@ public ReplicaProperties withContainers(List containers) { return this; } + /** + * Get the initContainers property: The init containers collection under a replica. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: The init containers collection under a replica. + * + * @param initContainers the initContainers value to set. + * @return the ReplicaProperties object itself. + */ + public ReplicaProperties withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + /** * Validates the instance. * @@ -67,5 +124,8 @@ public void validate() { if (containers() != null) { containers().forEach(e -> e.validate()); } + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java index 94e932f257deb..9a0c03e9dead0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/fluent/models/WorkloadProfileStatesInner.java @@ -10,7 +10,7 @@ import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** Collection of all the workload Profile States for a Premium Managed Environment.. */ +/** Collection of all the workload Profile States for a Managed Environment.. */ @Fluent public final class WorkloadProfileStatesInner extends ProxyResource { /* diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java index 8a3a3e3b2b10a..15172ec96e9cd 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/AvailableWorkloadProfilesClientImpl.java @@ -57,11 +57,10 @@ public final class AvailableWorkloadProfilesClientImpl implements AvailableWorkl */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface AvailableWorkloadProfilesService { + public interface AvailableWorkloadProfilesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}" - + "/availableManagedEnvironmentsWorkloadProfileTypes") + "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java index 98f328927105f..ca38979de6dc2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/BillingMetersClientImpl.java @@ -50,7 +50,7 @@ public final class BillingMetersClientImpl implements BillingMetersClient { */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface BillingMetersService { + public interface BillingMetersService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/billingMeters") @ExpectedResponses({200}) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java index 0e95dfc5f0119..2c083dfc0e7c1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificateImpl.java @@ -74,15 +74,15 @@ private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager( private String resourceGroupName; - private String environmentName; + private String connectedEnvironmentName; private String certificateName; private CertificatePatch updateCertificateEnvelope; - public CertificateImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + public CertificateImpl withExistingConnectedEnvironment(String resourceGroupName, String connectedEnvironmentName) { this.resourceGroupName = resourceGroupName; - this.environmentName = environmentName; + this.connectedEnvironmentName = connectedEnvironmentName; return this; } @@ -90,9 +90,9 @@ public Certificate create() { this.innerObject = serviceManager .serviceClient() - .getCertificates() + .getConnectedEnvironmentsCertificates() .createOrUpdateWithResponse( - resourceGroupName, environmentName, certificateName, this.innerModel(), Context.NONE) + resourceGroupName, connectedEnvironmentName, certificateName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -101,9 +101,9 @@ public Certificate create(Context context) { this.innerObject = serviceManager .serviceClient() - .getCertificates() + .getConnectedEnvironmentsCertificates() .createOrUpdateWithResponse( - resourceGroupName, environmentName, certificateName, this.innerModel(), context) + resourceGroupName, connectedEnvironmentName, certificateName, this.innerModel(), context) .getValue(); return this; } @@ -123,9 +123,13 @@ public Certificate apply() { this.innerObject = serviceManager .serviceClient() - .getCertificates() + .getConnectedEnvironmentsCertificates() .updateWithResponse( - resourceGroupName, environmentName, certificateName, updateCertificateEnvelope, Context.NONE) + resourceGroupName, + connectedEnvironmentName, + certificateName, + updateCertificateEnvelope, + Context.NONE) .getValue(); return this; } @@ -134,9 +138,9 @@ public Certificate apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getCertificates() + .getConnectedEnvironmentsCertificates() .updateWithResponse( - resourceGroupName, environmentName, certificateName, updateCertificateEnvelope, context) + resourceGroupName, connectedEnvironmentName, certificateName, updateCertificateEnvelope, context) .getValue(); return this; } @@ -146,7 +150,7 @@ public Certificate apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.connectedEnvironmentName = Utils.getValueFromIdByName(innerObject.id(), "connectedEnvironments"); this.certificateName = Utils.getValueFromIdByName(innerObject.id(), "certificates"); } @@ -154,8 +158,8 @@ public Certificate refresh() { this.innerObject = serviceManager .serviceClient() - .getCertificates() - .getWithResponse(resourceGroupName, environmentName, certificateName, Context.NONE) + .getConnectedEnvironmentsCertificates() + .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, Context.NONE) .getValue(); return this; } @@ -164,8 +168,8 @@ public Certificate refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getCertificates() - .getWithResponse(resourceGroupName, environmentName, certificateName, context) + .getConnectedEnvironmentsCertificates() + .getWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context) .getValue(); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java index b3ab88433a8df..3e60f999c0ac5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesClientImpl.java @@ -60,11 +60,10 @@ public final class CertificatesClientImpl implements CertificatesClient { */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface CertificatesService { + public interface CertificatesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/certificates") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> list( @@ -78,8 +77,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -94,8 +92,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -111,8 +108,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( @@ -127,8 +123,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> update( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java index 86498b92b8eef..9a24cb875758a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/CertificatesImpl.java @@ -12,6 +12,7 @@ import com.azure.resourcemanager.appcontainers.fluent.CertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; import com.azure.resourcemanager.appcontainers.models.Certificate; +import com.azure.resourcemanager.appcontainers.models.CertificatePatch; import com.azure.resourcemanager.appcontainers.models.Certificates; public final class CertificatesImpl implements Certificates { @@ -62,6 +63,38 @@ public Certificate get(String resourceGroupName, String environmentName, String } } + public Response createOrUpdateWithResponse( + String resourceGroupName, + String environmentName, + String certificateName, + CertificateInner certificateEnvelope, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, environmentName, certificateName, certificateEnvelope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Certificate createOrUpdate(String resourceGroupName, String environmentName, String certificateName) { + CertificateInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, environmentName, certificateName); + if (inner != null) { + return new CertificateImpl(inner, this.manager()); + } else { + return null; + } + } + public Response deleteWithResponse( String resourceGroupName, String environmentName, String certificateName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, certificateName, context); @@ -71,116 +104,39 @@ public void delete(String resourceGroupName, String environmentName, String cert this.serviceClient().delete(resourceGroupName, environmentName, certificateName); } - public Certificate 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", 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, environmentName, 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", 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, environmentName, 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", 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))); + public Response updateWithResponse( + String resourceGroupName, + String environmentName, + String certificateName, + CertificatePatch certificateEnvelope, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse(resourceGroupName, environmentName, certificateName, certificateEnvelope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CertificateImpl(inner.getValue(), this.manager())); + } else { + return null; } - this.deleteWithResponse(resourceGroupName, environmentName, certificateName, Context.NONE); } - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", 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))); + public Certificate update( + String resourceGroupName, + String environmentName, + String certificateName, + CertificatePatch certificateEnvelope) { + CertificateInner inner = + this.serviceClient().update(resourceGroupName, environmentName, certificateName, certificateEnvelope); + if (inner != null) { + return new CertificateImpl(inner, this.manager()); + } else { + return null; } - return this.deleteWithResponse(resourceGroupName, environmentName, certificateName, context); } private CertificatesClient serviceClient() { @@ -190,8 +146,4 @@ private CertificatesClient serviceClient() { private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { return this.serviceManager; } - - public CertificateImpl define(String name) { - return new CertificateImpl(name, this.manager()); - } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java index 1542491103f81..316012fa67ded 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentImpl.java @@ -4,10 +4,13 @@ package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.models.ConnectedEnvironmentInner; +import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityResponse; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironment; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentProvisioningState; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; @@ -159,7 +162,7 @@ public ConnectedEnvironment apply(Context context) { com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.connectedEnvironmentName = Utils.getValueFromIdByName(innerObject.id(), "connectedEnvironments"); } @@ -183,6 +186,21 @@ public ConnectedEnvironment refresh(Context context) { return this; } + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context) { + return serviceManager + .connectedEnvironments() + .checkNameAvailabilityWithResponse( + resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest, context); + } + + public CheckNameAvailabilityResponse checkNameAvailability( + CheckNameAvailabilityRequest checkNameAvailabilityRequest) { + return serviceManager + .connectedEnvironments() + .checkNameAvailability(resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest); + } + public ConnectedEnvironmentImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java index 4b0c4f9f133ee..5e48209c01446 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesClientImpl.java @@ -66,11 +66,10 @@ public final class ConnectedEnvironmentsCertificatesClientImpl implements Connec */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ConnectedEnvironmentsCertificatesService { + public interface ConnectedEnvironmentsCertificatesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/certificates") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> list( @@ -84,8 +83,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -100,8 +98,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -117,8 +114,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( @@ -133,8 +129,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> update( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java index 851e484803652..6c5a00ced3de9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsCertificatesImpl.java @@ -12,7 +12,6 @@ import com.azure.resourcemanager.appcontainers.fluent.ConnectedEnvironmentsCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; import com.azure.resourcemanager.appcontainers.models.Certificate; -import com.azure.resourcemanager.appcontainers.models.CertificatePatch; import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentsCertificates; public final class ConnectedEnvironmentsCertificatesImpl implements ConnectedEnvironmentsCertificates { @@ -64,39 +63,6 @@ public Certificate get(String resourceGroupName, String connectedEnvironmentName } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String connectedEnvironmentName, - String certificateName, - CertificateInner certificateEnvelope, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Certificate createOrUpdate( - String resourceGroupName, String connectedEnvironmentName, String certificateName) { - CertificateInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, connectedEnvironmentName, certificateName); - if (inner != null) { - return new CertificateImpl(inner, this.manager()); - } else { - return null; - } - } - public Response deleteWithResponse( String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context) { return this @@ -108,42 +74,122 @@ public void delete(String resourceGroupName, String connectedEnvironmentName, St this.serviceClient().delete(resourceGroupName, connectedEnvironmentName, certificateName); } - public Response updateWithResponse( - String resourceGroupName, - String connectedEnvironmentName, - String certificateName, - CertificatePatch certificateEnvelope, - Context context) { - Response inner = - this - .serviceClient() - .updateWithResponse( - resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CertificateImpl(inner.getValue(), this.manager())); - } else { - return null; + public Certificate 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 connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + 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, connectedEnvironmentName, certificateName, Context.NONE) + .getValue(); } - public Certificate update( - String resourceGroupName, - String connectedEnvironmentName, - String certificateName, - CertificatePatch certificateEnvelope) { - CertificateInner inner = - this - .serviceClient() - .update(resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope); - if (inner != null) { - return new CertificateImpl(inner, this.manager()); - } else { - return null; + 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 connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + 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, connectedEnvironmentName, 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 connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + 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.deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + 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.deleteWithResponse(resourceGroupName, connectedEnvironmentName, certificateName, context); } private ConnectedEnvironmentsCertificatesClient serviceClient() { @@ -153,4 +199,8 @@ private ConnectedEnvironmentsCertificatesClient serviceClient() { private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { return this.serviceManager; } + + public CertificateImpl define(String name) { + return new CertificateImpl(name, this.manager()); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java index c19ba549ecf2a..e502ade54c632 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsClientImpl.java @@ -68,7 +68,7 @@ public final class ConnectedEnvironmentsClientImpl implements ConnectedEnvironme */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ConnectedEnvironmentsService { + public interface ConnectedEnvironmentsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/connectedEnvironments") @ExpectedResponses({200}) @@ -82,8 +82,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listByResourceGroup( @@ -96,8 +95,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getByResourceGroup( @@ -111,8 +109,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> createOrUpdate( @@ -127,8 +124,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> delete( @@ -142,8 +138,7 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> update( @@ -157,8 +152,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> checkNameAvailability( @@ -843,7 +837,8 @@ private PollerFlux, ConnectedEnvironmentIn @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ConnectedEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope) + return this + .beginCreateOrUpdateAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope) .getSyncPoller(); } @@ -866,7 +861,8 @@ public SyncPoller, ConnectedEnvironmentInn String connectedEnvironmentName, ConnectedEnvironmentInner environmentEnvelope, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope, context) + return this + .beginCreateOrUpdateAsync(resourceGroupName, connectedEnvironmentName, environmentEnvelope, context) .getSyncPoller(); } @@ -1104,7 +1100,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String connectedEnvironmentName) { - return beginDeleteAsync(resourceGroupName, connectedEnvironmentName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, connectedEnvironmentName).getSyncPoller(); } /** @@ -1121,7 +1117,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String connectedEnvironmentName, Context context) { - return beginDeleteAsync(resourceGroupName, connectedEnvironmentName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, connectedEnvironmentName, context).getSyncPoller(); } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java index bb0656b535b89..7a8dd2baa954f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsClientImpl.java @@ -66,11 +66,10 @@ public final class ConnectedEnvironmentsDaprComponentsClientImpl implements Conn */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ConnectedEnvironmentsDaprComponentsService { + public interface ConnectedEnvironmentsDaprComponentsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/daprComponents") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> list( @@ -84,8 +83,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -100,8 +98,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -117,8 +114,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( @@ -133,8 +129,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listSecrets( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java index 14b9d452dbc31..a42732ed38b8c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsDaprComponentsImpl.java @@ -67,44 +67,6 @@ public DaprComponent get(String resourceGroupName, String connectedEnvironmentNa } } - public Response createOrUpdateWithResponse( - String resourceGroupName, - String connectedEnvironmentName, - String componentName, - DaprComponentInner daprComponentEnvelope, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, connectedEnvironmentName, componentName, daprComponentEnvelope, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DaprComponentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DaprComponent createOrUpdate( - String resourceGroupName, - String connectedEnvironmentName, - String componentName, - DaprComponentInner daprComponentEnvelope) { - DaprComponentInner inner = - this - .serviceClient() - .createOrUpdate(resourceGroupName, connectedEnvironmentName, componentName, daprComponentEnvelope); - if (inner != null) { - return new DaprComponentImpl(inner, this.manager()); - } else { - return null; - } - } - public Response deleteWithResponse( String resourceGroupName, String connectedEnvironmentName, String componentName, Context context) { return this @@ -144,6 +106,128 @@ public DaprSecretsCollection listSecrets( } } + public DaprComponent 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 connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + id))); + } + String componentName = Utils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + return this + .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, 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 connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + id))); + } + String componentName = Utils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + return this.getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, 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 connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + id))); + } + String componentName = Utils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + this.deleteWithResponse(resourceGroupName, connectedEnvironmentName, componentName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); + if (connectedEnvironmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectedEnvironments'.", + id))); + } + String componentName = Utils.getValueFromIdByName(id, "daprComponents"); + if (componentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); + } + return this.deleteWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); + } + private ConnectedEnvironmentsDaprComponentsClient serviceClient() { return this.innerClient; } @@ -151,4 +235,8 @@ private ConnectedEnvironmentsDaprComponentsClient serviceClient() { private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { return this.serviceManager; } + + public DaprComponentImpl define(String name) { + return new DaprComponentImpl(name, this.manager()); + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java index 2f185c945d124..9bfc8b8b89fad 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsImpl.java @@ -146,13 +146,13 @@ public CheckNameAvailabilityResponse checkNameAvailability( } public ConnectedEnvironment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); if (connectedEnvironmentName == null) { @@ -170,13 +170,13 @@ public ConnectedEnvironment getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); if (connectedEnvironmentName == null) { @@ -192,13 +192,13 @@ public Response getByIdWithResponse(String id, Context con } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); if (connectedEnvironmentName == null) { @@ -214,13 +214,13 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); + 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))); + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } String connectedEnvironmentName = Utils.getValueFromIdByName(id, "connectedEnvironments"); if (connectedEnvironmentName == null) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java index b74dc46476d27..511e12aa1d1b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ConnectedEnvironmentsStoragesClientImpl.java @@ -58,11 +58,10 @@ public final class ConnectedEnvironmentsStoragesClientImpl implements ConnectedE */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ConnectedEnvironmentsStoragesService { + public interface ConnectedEnvironmentsStoragesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/storages") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> list( @@ -76,8 +75,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -92,8 +90,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -109,8 +106,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java index 26f5c8d21376b..0fce8f4c58cc0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppImpl.java @@ -60,6 +60,10 @@ public ManagedServiceIdentity identity() { return this.innerModel().identity(); } + public String managedBy() { + return this.innerModel().managedBy(); + } + public SystemData systemData() { return this.innerModel().systemData(); } @@ -76,14 +80,18 @@ public String environmentId() { return this.innerModel().environmentId(); } - public String workloadProfileType() { - return this.innerModel().workloadProfileType(); + public String workloadProfileName() { + return this.innerModel().workloadProfileName(); } public String latestRevisionName() { return this.innerModel().latestRevisionName(); } + public String latestReadyRevisionName() { + return this.innerModel().latestReadyRevisionName(); + } + public String latestRevisionFqdn() { return this.innerModel().latestRevisionFqdn(); } @@ -175,7 +183,7 @@ public ContainerApp apply() { serviceManager .serviceClient() .getContainerApps() - .createOrUpdate(resourceGroupName, containerAppName, this.innerModel(), Context.NONE); + .update(resourceGroupName, containerAppName, this.innerModel(), Context.NONE); return this; } @@ -184,7 +192,7 @@ public ContainerApp apply(Context context) { serviceManager .serviceClient() .getContainerApps() - .createOrUpdate(resourceGroupName, containerAppName, this.innerModel(), context); + .update(resourceGroupName, containerAppName, this.innerModel(), context); return this; } @@ -268,6 +276,11 @@ public ContainerAppImpl withIdentity(ManagedServiceIdentity identity) { return this; } + public ContainerAppImpl withManagedBy(String managedBy) { + this.innerModel().withManagedBy(managedBy); + return this; + } + public ContainerAppImpl withManagedEnvironmentId(String managedEnvironmentId) { this.innerModel().withManagedEnvironmentId(managedEnvironmentId); return this; @@ -278,8 +291,8 @@ public ContainerAppImpl withEnvironmentId(String environmentId) { return this; } - public ContainerAppImpl withWorkloadProfileType(String workloadProfileType) { - this.innerModel().withWorkloadProfileType(workloadProfileType); + public ContainerAppImpl withWorkloadProfileName(String workloadProfileName) { + this.innerModel().withWorkloadProfileName(workloadProfileName); return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.java new file mode 100644 index 0000000000000..4fb1bf7119140 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppJobExecutionsImpl.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.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppJobExecutions; +import com.azure.resourcemanager.appcontainers.models.JobExecution; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ContainerAppJobExecutionsImpl implements ContainerAppJobExecutions { + private ContainerAppJobExecutionsInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + ContainerAppJobExecutionsImpl( + ContainerAppJobExecutionsInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 JobExecutionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public ContainerAppJobExecutionsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java index ae4e2dfa8dc68..058cdbb655956 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsApiClientImpl.java @@ -37,6 +37,9 @@ import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsRevisionsClient; import com.azure.resourcemanager.appcontainers.fluent.ContainerAppsSourceControlsClient; import com.azure.resourcemanager.appcontainers.fluent.DaprComponentsClient; +import com.azure.resourcemanager.appcontainers.fluent.JobsClient; +import com.azure.resourcemanager.appcontainers.fluent.JobsExecutionsClient; +import com.azure.resourcemanager.appcontainers.fluent.ManagedCertificatesClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentDiagnosticsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsClient; import com.azure.resourcemanager.appcontainers.fluent.ManagedEnvironmentsDiagnosticsClient; @@ -139,6 +142,78 @@ public ContainerAppsAuthConfigsClient getContainerAppsAuthConfigs() { return this.containerAppsAuthConfigs; } + /** The AvailableWorkloadProfilesClient object to access its operations. */ + private final AvailableWorkloadProfilesClient availableWorkloadProfiles; + + /** + * Gets the AvailableWorkloadProfilesClient object to access its operations. + * + * @return the AvailableWorkloadProfilesClient object. + */ + public AvailableWorkloadProfilesClient getAvailableWorkloadProfiles() { + return this.availableWorkloadProfiles; + } + + /** The BillingMetersClient object to access its operations. */ + private final BillingMetersClient billingMeters; + + /** + * Gets the BillingMetersClient object to access its operations. + * + * @return the BillingMetersClient object. + */ + public BillingMetersClient getBillingMeters() { + return this.billingMeters; + } + + /** The ConnectedEnvironmentsClient object to access its operations. */ + private final ConnectedEnvironmentsClient connectedEnvironments; + + /** + * Gets the ConnectedEnvironmentsClient object to access its operations. + * + * @return the ConnectedEnvironmentsClient object. + */ + public ConnectedEnvironmentsClient getConnectedEnvironments() { + return this.connectedEnvironments; + } + + /** The ConnectedEnvironmentsCertificatesClient object to access its operations. */ + private final ConnectedEnvironmentsCertificatesClient connectedEnvironmentsCertificates; + + /** + * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. + * + * @return the ConnectedEnvironmentsCertificatesClient object. + */ + public ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates() { + return this.connectedEnvironmentsCertificates; + } + + /** The ConnectedEnvironmentsDaprComponentsClient object to access its operations. */ + private final ConnectedEnvironmentsDaprComponentsClient connectedEnvironmentsDaprComponents; + + /** + * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. + * + * @return the ConnectedEnvironmentsDaprComponentsClient object. + */ + public ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents() { + return this.connectedEnvironmentsDaprComponents; + } + + /** The ConnectedEnvironmentsStoragesClient object to access its operations. */ + private final ConnectedEnvironmentsStoragesClient connectedEnvironmentsStorages; + + /** + * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. + * + * @return the ConnectedEnvironmentsStoragesClient object. + */ + public ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages() { + return this.connectedEnvironmentsStorages; + } + /** The ContainerAppsClient object to access its operations. */ private final ContainerAppsClient containerApps; @@ -175,18 +250,6 @@ public ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas() { return this.containerAppsRevisionReplicas; } - /** The DaprComponentsClient object to access its operations. */ - private final DaprComponentsClient daprComponents; - - /** - * Gets the DaprComponentsClient object to access its operations. - * - * @return the DaprComponentsClient object. - */ - public DaprComponentsClient getDaprComponents() { - return this.daprComponents; - } - /** The ContainerAppsDiagnosticsClient object to access its operations. */ private final ContainerAppsDiagnosticsClient containerAppsDiagnostics; @@ -235,6 +298,30 @@ public OperationsClient getOperations() { return this.operations; } + /** The JobsClient object to access its operations. */ + private final JobsClient jobs; + + /** + * Gets the JobsClient object to access its operations. + * + * @return the JobsClient object. + */ + public JobsClient getJobs() { + return this.jobs; + } + + /** The JobsExecutionsClient object to access its operations. */ + private final JobsExecutionsClient jobsExecutions; + + /** + * Gets the JobsExecutionsClient object to access its operations. + * + * @return the JobsExecutionsClient object. + */ + public JobsExecutionsClient getJobsExecutions() { + return this.jobsExecutions; + } + /** The ManagedEnvironmentsClient object to access its operations. */ private final ManagedEnvironmentsClient managedEnvironments; @@ -259,6 +346,18 @@ public CertificatesClient getCertificates() { return this.certificates; } + /** The ManagedCertificatesClient object to access its operations. */ + private final ManagedCertificatesClient managedCertificates; + + /** + * Gets the ManagedCertificatesClient object to access its operations. + * + * @return the ManagedCertificatesClient object. + */ + public ManagedCertificatesClient getManagedCertificates() { + return this.managedCertificates; + } + /** The NamespacesClient object to access its operations. */ private final NamespacesClient namespaces; @@ -271,6 +370,18 @@ public NamespacesClient getNamespaces() { return this.namespaces; } + /** The DaprComponentsClient object to access its operations. */ + private final DaprComponentsClient daprComponents; + + /** + * Gets the DaprComponentsClient object to access its operations. + * + * @return the DaprComponentsClient object. + */ + public DaprComponentsClient getDaprComponents() { + return this.daprComponents; + } + /** The ManagedEnvironmentsStoragesClient object to access its operations. */ private final ManagedEnvironmentsStoragesClient managedEnvironmentsStorages; @@ -295,78 +406,6 @@ public ContainerAppsSourceControlsClient getContainerAppsSourceControls() { return this.containerAppsSourceControls; } - /** The ConnectedEnvironmentsClient object to access its operations. */ - private final ConnectedEnvironmentsClient connectedEnvironments; - - /** - * Gets the ConnectedEnvironmentsClient object to access its operations. - * - * @return the ConnectedEnvironmentsClient object. - */ - public ConnectedEnvironmentsClient getConnectedEnvironments() { - return this.connectedEnvironments; - } - - /** The ConnectedEnvironmentsCertificatesClient object to access its operations. */ - private final ConnectedEnvironmentsCertificatesClient connectedEnvironmentsCertificates; - - /** - * Gets the ConnectedEnvironmentsCertificatesClient object to access its operations. - * - * @return the ConnectedEnvironmentsCertificatesClient object. - */ - public ConnectedEnvironmentsCertificatesClient getConnectedEnvironmentsCertificates() { - return this.connectedEnvironmentsCertificates; - } - - /** The ConnectedEnvironmentsDaprComponentsClient object to access its operations. */ - private final ConnectedEnvironmentsDaprComponentsClient connectedEnvironmentsDaprComponents; - - /** - * Gets the ConnectedEnvironmentsDaprComponentsClient object to access its operations. - * - * @return the ConnectedEnvironmentsDaprComponentsClient object. - */ - public ConnectedEnvironmentsDaprComponentsClient getConnectedEnvironmentsDaprComponents() { - return this.connectedEnvironmentsDaprComponents; - } - - /** The ConnectedEnvironmentsStoragesClient object to access its operations. */ - private final ConnectedEnvironmentsStoragesClient connectedEnvironmentsStorages; - - /** - * Gets the ConnectedEnvironmentsStoragesClient object to access its operations. - * - * @return the ConnectedEnvironmentsStoragesClient object. - */ - public ConnectedEnvironmentsStoragesClient getConnectedEnvironmentsStorages() { - return this.connectedEnvironmentsStorages; - } - - /** The AvailableWorkloadProfilesClient object to access its operations. */ - private final AvailableWorkloadProfilesClient availableWorkloadProfiles; - - /** - * Gets the AvailableWorkloadProfilesClient object to access its operations. - * - * @return the AvailableWorkloadProfilesClient object. - */ - public AvailableWorkloadProfilesClient getAvailableWorkloadProfiles() { - return this.availableWorkloadProfiles; - } - - /** The BillingMetersClient object to access its operations. */ - private final BillingMetersClient billingMeters; - - /** - * Gets the BillingMetersClient object to access its operations. - * - * @return the BillingMetersClient object. - */ - public BillingMetersClient getBillingMeters() { - return this.billingMeters; - } - /** * Initializes an instance of ContainerAppsApiClient client. * @@ -389,27 +428,30 @@ public BillingMetersClient getBillingMeters() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-06-01-preview"; + this.apiVersion = "2023-04-01-preview"; this.containerAppsAuthConfigs = new ContainerAppsAuthConfigsClientImpl(this); + this.availableWorkloadProfiles = new AvailableWorkloadProfilesClientImpl(this); + this.billingMeters = new BillingMetersClientImpl(this); + this.connectedEnvironments = new ConnectedEnvironmentsClientImpl(this); + this.connectedEnvironmentsCertificates = new ConnectedEnvironmentsCertificatesClientImpl(this); + this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsClientImpl(this); + this.connectedEnvironmentsStorages = new ConnectedEnvironmentsStoragesClientImpl(this); this.containerApps = new ContainerAppsClientImpl(this); this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); this.containerAppsRevisionReplicas = new ContainerAppsRevisionReplicasClientImpl(this); - this.daprComponents = new DaprComponentsClientImpl(this); this.containerAppsDiagnostics = new ContainerAppsDiagnosticsClientImpl(this); this.managedEnvironmentDiagnostics = new ManagedEnvironmentDiagnosticsClientImpl(this); this.managedEnvironmentsDiagnostics = new ManagedEnvironmentsDiagnosticsClientImpl(this); this.operations = new OperationsClientImpl(this); + this.jobs = new JobsClientImpl(this); + this.jobsExecutions = new JobsExecutionsClientImpl(this); this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); this.certificates = new CertificatesClientImpl(this); + this.managedCertificates = new ManagedCertificatesClientImpl(this); this.namespaces = new NamespacesClientImpl(this); + this.daprComponents = new DaprComponentsClientImpl(this); this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); - this.connectedEnvironments = new ConnectedEnvironmentsClientImpl(this); - this.connectedEnvironmentsCertificates = new ConnectedEnvironmentsCertificatesClientImpl(this); - this.connectedEnvironmentsDaprComponents = new ConnectedEnvironmentsDaprComponentsClientImpl(this); - this.connectedEnvironmentsStorages = new ConnectedEnvironmentsStoragesClientImpl(this); - this.availableWorkloadProfiles = new AvailableWorkloadProfilesClientImpl(this); - this.billingMeters = new BillingMetersClientImpl(this); } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java index 7af8a2bde9c42..e52c6e91fd925 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsAuthConfigsClientImpl.java @@ -59,11 +59,10 @@ public final class ContainerAppsAuthConfigsClientImpl implements ContainerAppsAu */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ContainerAppsAuthConfigsService { + public interface ContainerAppsAuthConfigsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/authConfigs") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listByContainerApp( @@ -77,8 +76,7 @@ Mono> listByContainerApp( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/authConfigs/{authConfigName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -93,8 +91,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/authConfigs/{authConfigName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -110,8 +107,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/authConfigs/{authConfigName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java index 0aafa672aee81..c3119a5e81b39 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsClientImpl.java @@ -69,7 +69,7 @@ public final class ContainerAppsClientImpl implements ContainerAppsClient { */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ContainerAppsService { + public interface ContainerAppsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps") @ExpectedResponses({200}) @@ -95,10 +95,12 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) + @UnexpectedResponseExceptionType( + value = ManagementException.class, + code = {404}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getByResourceGroup( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -110,8 +112,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> createOrUpdate( @@ -126,8 +127,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> delete( @@ -141,9 +141,8 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}") - @ExpectedResponses({202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> update( @HostParam("$host") String endpoint, @@ -157,8 +156,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/listCustomHostNameAnalysis") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listCustomHostnameAnalysis( @@ -173,8 +171,7 @@ Mono> listCustomHostnameAnalysis( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/listSecrets") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listSecrets( @@ -188,10 +185,12 @@ Mono> listSecrets( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/getAuthtoken") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) + @UnexpectedResponseExceptionType( + value = ManagementException.class, + code = {404}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getAuthToken( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -536,7 +535,8 @@ public PagedIterable listByResourceGroup(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. */ @@ -586,7 +586,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. */ @@ -632,7 +633,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App on successful completion of {@link Mono}. */ @@ -649,7 +651,8 @@ private Mono getByResourceGroupAsync(String resourceGroupName * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -665,7 +668,8 @@ public Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App. */ @@ -850,7 +854,7 @@ private PollerFlux, ContainerAppInner> beginCreate @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ContainerAppInner> beginCreateOrUpdate( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).getSyncPoller(); } /** @@ -868,7 +872,8 @@ public SyncPoller, ContainerAppInner> beginCreateO @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ContainerAppInner> beginCreateOrUpdate( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context) + return this + .beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context) .getSyncPoller(); } @@ -1094,7 +1099,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName) { - return beginDeleteAsync(resourceGroupName, containerAppName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, containerAppName).getSyncPoller(); } /** @@ -1111,7 +1116,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String containerAppName, Context context) { - return beginDeleteAsync(resourceGroupName, containerAppName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, containerAppName, context).getSyncPoller(); } /** @@ -1189,7 +1194,7 @@ public void delete(String resourceGroupName, String containerAppName, Context co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return container App along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1249,7 +1254,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return container App along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1305,17 +1310,21 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync( + private PollerFlux, ContainerAppInner> beginUpdateAsync( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { Mono>> mono = updateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerAppInner.class, + ContainerAppInner.class, + this.client.getContext()); } /** @@ -1330,17 +1339,18 @@ private PollerFlux, Void> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync( + private PollerFlux, ContainerAppInner> beginUpdateAsync( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { context = this.client.mergeContext(context); Mono>> mono = updateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerAppInner.class, ContainerAppInner.class, context); } /** @@ -1354,12 +1364,12 @@ private PollerFlux, Void> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpdate( + public SyncPoller, ContainerAppInner> beginUpdate( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).getSyncPoller(); } /** @@ -1374,12 +1384,14 @@ public SyncPoller, Void> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of container App. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpdate( + public SyncPoller, ContainerAppInner> beginUpdate( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).getSyncPoller(); + return this + .beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context) + .getSyncPoller(); } /** @@ -1393,10 +1405,10 @@ public SyncPoller, Void> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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. + * @return container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( + private Mono updateAsync( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope) .last() @@ -1415,10 +1427,10 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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. + * @return container App on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( + private Mono updateAsync( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context) .last() @@ -1436,10 +1448,12 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - updateAsync(resourceGroupName, containerAppName, containerAppEnvelope).block(); + public ContainerAppInner update( + String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { + return updateAsync(resourceGroupName, containerAppName, containerAppEnvelope).block(); } /** @@ -1454,11 +1468,12 @@ public void update(String resourceGroupName, String containerAppName, ContainerA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update( + public ContainerAppInner update( String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - updateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).block(); + return updateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).block(); } /** @@ -1768,7 +1783,8 @@ public SecretsCollectionInner listSecrets(String resourceGroupName, String conta * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app along with {@link Response} on successful completion of {@link Mono}. */ @@ -1818,7 +1834,8 @@ private Mono> getAuthTokenWithResponseAsync * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app along with {@link Response} on successful completion of {@link Mono}. */ @@ -1864,7 +1881,8 @@ private Mono> getAuthTokenWithResponseAsync * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app on successful completion of {@link Mono}. */ @@ -1881,7 +1899,8 @@ private Mono getAuthTokenAsync(String resourceGroupN * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app along with {@link Response}. */ @@ -1897,7 +1916,8 @@ public Response getAuthTokenWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java index fa0c2d32eb4a7..f56a404c5e7fb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsDiagnosticsClientImpl.java @@ -60,11 +60,10 @@ public final class ContainerAppsDiagnosticsClientImpl implements ContainerAppsDi */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ContainerAppsDiagnosticsService { + public interface ContainerAppsDiagnosticsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/detectors") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listDetectors( @@ -78,8 +77,7 @@ Mono> listDetectors( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/detectors/{detectorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getDetector( @@ -94,8 +92,7 @@ Mono> getDetector( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/detectorProperties/revisionsApi/revisions/") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listRevisions( @@ -110,8 +107,7 @@ Mono> listRevisions( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getRevision( @@ -126,10 +122,12 @@ Mono> getRevision( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/detectorProperties/rootApi/") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) + @UnexpectedResponseExceptionType( + value = ManagementException.class, + code = {404}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getRoot( @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -879,7 +877,8 @@ public RevisionInner getRevision(String resourceGroupName, String containerAppNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. */ @@ -929,7 +928,8 @@ private Mono> getRootWithResponseAsync( * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}. */ @@ -975,7 +975,8 @@ private Mono> getRootWithResponseAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App on successful completion of {@link Mono}. */ @@ -992,7 +993,8 @@ private Mono getRootAsync(String resourceGroupName, String co * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -1008,7 +1010,8 @@ public Response getRootWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java index 10d93f3c80fc7..2487493c7ff6a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsImpl.java @@ -86,15 +86,6 @@ public void delete(String resourceGroupName, String containerAppName, Context co this.serviceClient().delete(resourceGroupName, containerAppName, context); } - public void update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) { - this.serviceClient().update(resourceGroupName, containerAppName, containerAppEnvelope); - } - - public void update( - String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) { - this.serviceClient().update(resourceGroupName, containerAppName, containerAppEnvelope, context); - } - public Response listCustomHostnameAnalysisWithResponse( String resourceGroupName, String containerAppName, String customHostname, Context context) { Response inner = diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java index 6b7ce6545dd60..021d8be1c3e4d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionReplicasClientImpl.java @@ -55,11 +55,10 @@ public final class ContainerAppsRevisionReplicasClientImpl implements ContainerA */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ContainerAppsRevisionReplicasService { + public interface ContainerAppsRevisionReplicasService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getReplica( @@ -75,8 +74,7 @@ Mono> getReplica( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions/{revisionName}/replicas") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listReplicas( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java index eb37e3d57d3ab..b7b32bc2b31a5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsRevisionsClientImpl.java @@ -57,11 +57,10 @@ public final class ContainerAppsRevisionsClientImpl implements ContainerAppsRevi */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ContainerAppsRevisionsService { + public interface ContainerAppsRevisionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listRevisions( @@ -76,8 +75,7 @@ Mono> listRevisions( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions/{revisionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getRevision( @@ -92,8 +90,7 @@ Mono> getRevision( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions/{revisionName}/activate") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/activate") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> activateRevision( @@ -108,8 +105,7 @@ Mono> activateRevision( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions/{revisionName}/deactivate") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/deactivate") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> deactivateRevision( @@ -124,8 +120,7 @@ Mono> deactivateRevision( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/revisions/{revisionName}/restart") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/restart") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> restartRevision( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java index 2d24f2d839e3d..68605a00c5567 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ContainerAppsSourceControlsClientImpl.java @@ -65,11 +65,10 @@ public final class ContainerAppsSourceControlsClientImpl implements ContainerApp */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ContainerAppsSourceControlsService { + public interface ContainerAppsSourceControlsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/sourcecontrols") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listByContainerApp( @@ -83,8 +82,7 @@ Mono> listByContainerApp( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/sourcecontrols/{sourceControlName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -99,8 +97,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/sourcecontrols/{sourceControlName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> createOrUpdate( @@ -116,8 +113,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" - + "/{containerAppName}/sourcecontrols/{sourceControlName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> delete( @@ -697,7 +693,8 @@ public SyncPoller, SourceControlInner> beginCreat String containerAppName, String sourceControlName, SourceControlInner sourceControlEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope) + return this + .beginCreateOrUpdateAsync(resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope) .getSyncPoller(); } @@ -721,7 +718,8 @@ public SyncPoller, SourceControlInner> beginCreat String sourceControlName, SourceControlInner sourceControlEnvelope, Context context) { - return beginCreateOrUpdateAsync( + return this + .beginCreateOrUpdateAsync( resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, context) .getSyncPoller(); } @@ -989,7 +987,7 @@ private PollerFlux, Void> beginDeleteAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String containerAppName, String sourceControlName) { - return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName).getSyncPoller(); } /** @@ -1007,7 +1005,7 @@ public SyncPoller, Void> beginDelete( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String containerAppName, String sourceControlName, Context context) { - return beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, containerAppName, sourceControlName, context).getSyncPoller(); } /** diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java index 0585f315609e4..f4699fac8b923 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentImpl.java @@ -97,13 +97,14 @@ private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager( private String resourceGroupName; - private String environmentName; + private String connectedEnvironmentName; private String componentName; - public DaprComponentImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + public DaprComponentImpl withExistingConnectedEnvironment( + String resourceGroupName, String connectedEnvironmentName) { this.resourceGroupName = resourceGroupName; - this.environmentName = environmentName; + this.connectedEnvironmentName = connectedEnvironmentName; return this; } @@ -111,9 +112,9 @@ public DaprComponent create() { this.innerObject = serviceManager .serviceClient() - .getDaprComponents() + .getConnectedEnvironmentsDaprComponents() .createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, this.innerModel(), Context.NONE) + resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -122,9 +123,9 @@ public DaprComponent create(Context context) { this.innerObject = serviceManager .serviceClient() - .getDaprComponents() + .getConnectedEnvironmentsDaprComponents() .createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, this.innerModel(), context) + resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), context) .getValue(); return this; } @@ -143,9 +144,9 @@ public DaprComponent apply() { this.innerObject = serviceManager .serviceClient() - .getDaprComponents() + .getConnectedEnvironmentsDaprComponents() .createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, this.innerModel(), Context.NONE) + resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), Context.NONE) .getValue(); return this; } @@ -154,9 +155,9 @@ public DaprComponent apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getDaprComponents() + .getConnectedEnvironmentsDaprComponents() .createOrUpdateWithResponse( - resourceGroupName, environmentName, componentName, this.innerModel(), context) + resourceGroupName, connectedEnvironmentName, componentName, this.innerModel(), context) .getValue(); return this; } @@ -167,7 +168,7 @@ public DaprComponent apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.connectedEnvironmentName = Utils.getValueFromIdByName(innerObject.id(), "connectedEnvironments"); this.componentName = Utils.getValueFromIdByName(innerObject.id(), "daprComponents"); } @@ -175,8 +176,8 @@ public DaprComponent refresh() { this.innerObject = serviceManager .serviceClient() - .getDaprComponents() - .getWithResponse(resourceGroupName, environmentName, componentName, Context.NONE) + .getConnectedEnvironmentsDaprComponents() + .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, Context.NONE) .getValue(); return this; } @@ -185,20 +186,22 @@ public DaprComponent refresh(Context context) { this.innerObject = serviceManager .serviceClient() - .getDaprComponents() - .getWithResponse(resourceGroupName, environmentName, componentName, context) + .getConnectedEnvironmentsDaprComponents() + .getWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context) .getValue(); return this; } public Response listSecretsWithResponse(Context context) { return serviceManager - .daprComponents() - .listSecretsWithResponse(resourceGroupName, environmentName, componentName, context); + .connectedEnvironmentsDaprComponents() + .listSecretsWithResponse(resourceGroupName, connectedEnvironmentName, componentName, context); } public DaprSecretsCollection listSecrets() { - return serviceManager.daprComponents().listSecrets(resourceGroupName, environmentName, componentName); + return serviceManager + .connectedEnvironmentsDaprComponents() + .listSecrets(resourceGroupName, connectedEnvironmentName, componentName); } public DaprComponentImpl withComponentType(String componentType) { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java index 17ea587bad671..fde054b8f7f2e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsClientImpl.java @@ -60,11 +60,10 @@ public final class DaprComponentsClientImpl implements DaprComponentsClient { */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface DaprComponentsService { + public interface DaprComponentsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/daprComponents") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> list( @@ -78,8 +77,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/daprComponents/{componentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -94,8 +92,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/daprComponents/{componentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -111,8 +108,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/daprComponents/{componentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( @@ -127,8 +123,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listSecrets( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java index 0be16fce31377..516bc044c8fe6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprComponentsImpl.java @@ -65,6 +65,44 @@ public DaprComponent get(String resourceGroupName, String environmentName, Strin } } + public Response createOrUpdateWithResponse( + String resourceGroupName, + String environmentName, + String componentName, + DaprComponentInner daprComponentEnvelope, + Context context) { + Response inner = + this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, environmentName, componentName, daprComponentEnvelope, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DaprComponentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DaprComponent createOrUpdate( + String resourceGroupName, + String environmentName, + String componentName, + DaprComponentInner daprComponentEnvelope) { + DaprComponentInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, environmentName, componentName, daprComponentEnvelope); + if (inner != null) { + return new DaprComponentImpl(inner, this.manager()); + } else { + return null; + } + } + public Response deleteWithResponse( String resourceGroupName, String environmentName, String componentName, Context context) { return this.serviceClient().deleteWithResponse(resourceGroupName, environmentName, componentName, context); @@ -99,122 +137,6 @@ public DaprSecretsCollection listSecrets(String resourceGroupName, String enviro } } - public DaprComponent 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); - } - String componentName = Utils.getValueFromIdByName(id, "daprComponents"); - if (componentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); - } - return this.getWithResponse(resourceGroupName, environmentName, componentName, 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); - } - String componentName = Utils.getValueFromIdByName(id, "daprComponents"); - if (componentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); - } - return this.getWithResponse(resourceGroupName, environmentName, componentName, 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); - } - String componentName = Utils.getValueFromIdByName(id, "daprComponents"); - if (componentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); - } - this.deleteWithResponse(resourceGroupName, environmentName, componentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); - if (environmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); - } - String componentName = Utils.getValueFromIdByName(id, "daprComponents"); - if (componentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'daprComponents'.", id))); - } - return this.deleteWithResponse(resourceGroupName, environmentName, componentName, context); - } - private DaprComponentsClient serviceClient() { return this.innerClient; } @@ -222,8 +144,4 @@ private DaprComponentsClient serviceClient() { private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { return this.serviceManager; } - - public DaprComponentImpl define(String name) { - return new DaprComponentImpl(name, this.manager()); - } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java index e515816a4cfb0..444784c197fe4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/DaprSecretsCollectionImpl.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.appcontainers.implementation; import com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner; +import com.azure.resourcemanager.appcontainers.models.DaprSecret; import com.azure.resourcemanager.appcontainers.models.DaprSecretsCollection; -import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Collections; import java.util.List; @@ -22,8 +22,8 @@ public final class DaprSecretsCollectionImpl implements DaprSecretsCollection { this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner); } else { diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionBaseImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionBaseImpl.java new file mode 100644 index 0000000000000..78e2d345844d2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionBaseImpl.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.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.azure.resourcemanager.appcontainers.models.JobExecutionBase; + +public final class JobExecutionBaseImpl implements JobExecutionBase { + private JobExecutionBaseInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + JobExecutionBaseImpl( + JobExecutionBaseInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public JobExecutionBaseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java new file mode 100644 index 0000000000000..16c34c6f75562 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobExecutionImpl.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import com.azure.resourcemanager.appcontainers.models.JobExecution; +import com.azure.resourcemanager.appcontainers.models.JobExecutionRunningState; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import java.time.OffsetDateTime; + +public final class JobExecutionImpl implements JobExecution { + private JobExecutionInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + JobExecutionImpl( + JobExecutionInner innerObject, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String id() { + return this.innerModel().id(); + } + + public String type() { + return this.innerModel().type(); + } + + public JobExecutionRunningState status() { + return this.innerModel().status(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public JobExecutionTemplate template() { + return this.innerModel().template(); + } + + public JobExecutionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java new file mode 100644 index 0000000000000..633889c12d1fd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.models.JobInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppJobExecutions; +import com.azure.resourcemanager.appcontainers.models.Job; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobExecutionBase; +import com.azure.resourcemanager.appcontainers.models.JobExecutionNamesCollection; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import com.azure.resourcemanager.appcontainers.models.JobPatchProperties; +import com.azure.resourcemanager.appcontainers.models.JobPatchPropertiesProperties; +import com.azure.resourcemanager.appcontainers.models.JobProvisioningState; +import com.azure.resourcemanager.appcontainers.models.JobSecretsCollection; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class JobImpl implements Job, Job.Definition, Job.Update { + private JobInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 ManagedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public JobProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String environmentId() { + return this.innerModel().environmentId(); + } + + public String workloadProfileName() { + return this.innerModel().workloadProfileName(); + } + + public JobConfiguration configuration() { + return this.innerModel().configuration(); + } + + public JobTemplate template() { + return this.innerModel().template(); + } + + public List outboundIpAddresses() { + List inner = this.innerModel().outboundIpAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String eventStreamEndpoint() { + return this.innerModel().eventStreamEndpoint(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public JobInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String jobName; + + private JobPatchProperties updateJobEnvelope; + + public JobImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Job create() { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .createOrUpdate(resourceGroupName, jobName, this.innerModel(), Context.NONE); + return this; + } + + public Job create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .createOrUpdate(resourceGroupName, jobName, this.innerModel(), context); + return this; + } + + JobImpl(String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new JobInner(); + this.serviceManager = serviceManager; + this.jobName = name; + } + + public JobImpl update() { + this.updateJobEnvelope = new JobPatchProperties(); + return this; + } + + public Job apply() { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .update(resourceGroupName, jobName, updateJobEnvelope, Context.NONE); + return this; + } + + public Job apply(Context context) { + this.innerObject = + serviceManager.serviceClient().getJobs().update(resourceGroupName, jobName, updateJobEnvelope, context); + return this; + } + + JobImpl(JobInner innerObject, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.jobName = Utils.getValueFromIdByName(innerObject.id(), "jobs"); + } + + public Job refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .getByResourceGroupWithResponse(resourceGroupName, jobName, Context.NONE) + .getValue(); + return this; + } + + public Job refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getJobs() + .getByResourceGroupWithResponse(resourceGroupName, jobName, context) + .getValue(); + return this; + } + + public JobExecutionBase start(JobExecutionTemplate template) { + return serviceManager.jobs().start(resourceGroupName, jobName, template); + } + + public JobExecutionBase start(JobExecutionTemplate template, Context context) { + return serviceManager.jobs().start(resourceGroupName, jobName, template, context); + } + + public ContainerAppJobExecutions stopMultipleExecutions(JobExecutionNamesCollection jobExecutionName) { + return serviceManager.jobs().stopMultipleExecutions(resourceGroupName, jobName, jobExecutionName); + } + + public ContainerAppJobExecutions stopMultipleExecutions( + JobExecutionNamesCollection jobExecutionName, Context context) { + return serviceManager.jobs().stopMultipleExecutions(resourceGroupName, jobName, jobExecutionName, context); + } + + public Response listSecretsWithResponse(Context context) { + return serviceManager.jobs().listSecretsWithResponse(resourceGroupName, jobName, context); + } + + public JobSecretsCollection listSecrets() { + return serviceManager.jobs().listSecrets(resourceGroupName, jobName); + } + + public JobImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public JobImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public JobImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateJobEnvelope.withTags(tags); + return this; + } + } + + public JobImpl withIdentity(ManagedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateJobEnvelope.withIdentity(identity); + return this; + } + } + + public JobImpl withEnvironmentId(String environmentId) { + this.innerModel().withEnvironmentId(environmentId); + return this; + } + + public JobImpl withWorkloadProfileName(String workloadProfileName) { + this.innerModel().withWorkloadProfileName(workloadProfileName); + return this; + } + + public JobImpl withConfiguration(JobConfiguration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public JobImpl withTemplate(JobTemplate template) { + this.innerModel().withTemplate(template); + return this; + } + + public JobImpl withProperties(JobPatchPropertiesProperties properties) { + this.updateJobEnvelope.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.java new file mode 100644 index 0000000000000..552293d405e18 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobSecretsCollectionImpl.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.appcontainers.implementation; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; +import com.azure.resourcemanager.appcontainers.models.JobSecretsCollection; +import com.azure.resourcemanager.appcontainers.models.Secret; +import java.util.Collections; +import java.util.List; + +public final class JobSecretsCollectionImpl implements JobSecretsCollection { + private JobSecretsCollectionInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + JobSecretsCollectionImpl( + JobSecretsCollectionInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 JobSecretsCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java new file mode 100644 index 0000000000000..a80dbbdbcba04 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsClientImpl.java @@ -0,0 +1,2546 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.JobsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.appcontainers.models.JobExecutionNamesCollection; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import com.azure.resourcemanager.appcontainers.models.JobPatchProperties; +import com.azure.resourcemanager.appcontainers.models.JobsCollection; +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 JobsClient. */ +public final class JobsClientImpl implements JobsClient { + /** The proxy service used to perform REST calls. */ + private final JobsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of JobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobsClientImpl(ContainerAppsApiClientImpl client) { + this.service = RestProxy.create(JobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientJobs to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface JobsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobInner jobEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobPatchProperties jobEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") JobExecutionTemplate template, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> stopExecution( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jobName") String jobName, + @PathParam("jobExecutionName") String jobExecutionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> stopMultipleExecutions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jobName") String jobName, + @BodyParam("application/json") JobExecutionNamesCollection jobExecutionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listSecrets( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @PathParam("jobName") String jobName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.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(DefaultErrorResponseErrorException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String jobName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String jobName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, jobName, context).block(); + } + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner getByResourceGroup(String resourceGroupName, String jobName) { + return getByResourceGroupWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String jobName, JobInner jobEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobEnvelope == null) { + return Mono.error(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); + } else { + jobEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + jobEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobEnvelope == null) { + return Mono.error(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); + } else { + jobEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + jobEnvelope, + accept, + context); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginCreateOrUpdateAsync( + String resourceGroupName, String jobName, JobInner jobEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, jobName, jobEnvelope); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, this.client.getContext()); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginCreateOrUpdateAsync( + String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, jobName, jobEnvelope, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, context); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginCreateOrUpdate( + String resourceGroupName, String jobName, JobInner jobEnvelope) { + return this.beginCreateOrUpdateAsync(resourceGroupName, jobName, jobEnvelope).getSyncPoller(); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginCreateOrUpdate( + String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, jobName, jobEnvelope, context).getSyncPoller(); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String jobName, JobInner jobEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, jobName, jobEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, jobName, jobEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope) { + return createOrUpdateAsync(resourceGroupName, jobName, jobEnvelope).block(); + } + + /** + * Create or Update a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner createOrUpdate(String resourceGroupName, String jobName, JobInner jobEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, jobName, jobEnvelope, context).block(); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all 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 jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all 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 jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String jobName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String jobName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, jobName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName) { + return this.beginDeleteAsync(resourceGroupName, jobName).getSyncPoller(); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String jobName, Context context) { + return this.beginDeleteAsync(resourceGroupName, jobName, context).getSyncPoller(); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 jobName) { + return beginDeleteAsync(resourceGroupName, jobName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 jobName, Context context) { + return beginDeleteAsync(resourceGroupName, jobName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 jobName) { + deleteAsync(resourceGroupName, jobName).block(); + } + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 jobName, Context context) { + deleteAsync(resourceGroupName, jobName, context).block(); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobEnvelope == null) { + return Mono.error(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); + } else { + jobEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + jobEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobEnvelope == null) { + return Mono.error(new IllegalArgumentException("Parameter jobEnvelope is required and cannot be null.")); + } else { + jobEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + jobEnvelope, + accept, + context); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginUpdateAsync( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, jobName, jobEnvelope); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, this.client.getContext()); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobInner> beginUpdateAsync( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, jobName, jobEnvelope, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobInner.class, JobInner.class, context); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginUpdate( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + return this.beginUpdateAsync(resourceGroupName, jobName, jobEnvelope).getSyncPoller(); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App Job. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobInner> beginUpdate( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { + return this.beginUpdateAsync(resourceGroupName, jobName, jobEnvelope, context).getSyncPoller(); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + return beginUpdateAsync(resourceGroupName, jobName, jobEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { + return beginUpdateAsync(resourceGroupName, jobName, jobEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope) { + return updateAsync(resourceGroupName, jobName, jobEnvelope).block(); + } + + /** + * Update properties of a Container Apps Job + * + *

Patches a Container Apps Job using JSON Merge Patch. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobEnvelope Properties used to create a container apps job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobInner update(String resourceGroupName, String jobName, JobPatchProperties jobEnvelope, Context context) { + return updateAsync(resourceGroupName, jobName, jobEnvelope, context).block(); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String jobName, JobExecutionTemplate template) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (template == null) { + return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); + } else { + template.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + template, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (template == null) { + return Mono.error(new IllegalArgumentException("Parameter template is required and cannot be null.")); + } else { + template.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + template, + accept, + context); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobExecutionBaseInner> beginStartAsync( + String resourceGroupName, String jobName, JobExecutionTemplate template) { + Mono>> mono = startWithResponseAsync(resourceGroupName, jobName, template); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + JobExecutionBaseInner.class, + JobExecutionBaseInner.class, + this.client.getContext()); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, JobExecutionBaseInner> beginStartAsync( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, jobName, template, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), JobExecutionBaseInner.class, JobExecutionBaseInner.class, context); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobExecutionBaseInner> beginStart( + String resourceGroupName, String jobName, JobExecutionTemplate template) { + return this.beginStartAsync(resourceGroupName, jobName, template).getSyncPoller(); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, JobExecutionBaseInner> beginStart( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { + return this.beginStartAsync(resourceGroupName, jobName, template, context).getSyncPoller(); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String jobName, JobExecutionTemplate template) { + return beginStartAsync(resourceGroupName, jobName, template) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { + return beginStartAsync(resourceGroupName, jobName, template, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobExecutionBaseInner start(String resourceGroupName, String jobName, JobExecutionTemplate template) { + return startAsync(resourceGroupName, jobName, template).block(); + } + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobExecutionBaseInner start( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { + return startAsync(resourceGroupName, jobName, template, context).block(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all 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>> stopExecutionWithResponseAsync( + String resourceGroupName, String jobName, String jobExecutionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopExecution( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jobName, + jobExecutionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all 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>> stopExecutionWithResponseAsync( + String resourceGroupName, String jobName, String jobExecutionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopExecution( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jobName, + jobExecutionName, + accept, + context); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopExecutionAsync( + String resourceGroupName, String jobName, String jobExecutionName) { + Mono>> mono = + stopExecutionWithResponseAsync(resourceGroupName, jobName, jobExecutionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginStopExecutionAsync( + String resourceGroupName, String jobName, String jobExecutionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopExecutionWithResponseAsync(resourceGroupName, jobName, jobExecutionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopExecution( + String resourceGroupName, String jobName, String jobExecutionName) { + return this.beginStopExecutionAsync(resourceGroupName, jobName, jobExecutionName).getSyncPoller(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStopExecution( + String resourceGroupName, String jobName, String jobExecutionName, Context context) { + return this.beginStopExecutionAsync(resourceGroupName, jobName, jobExecutionName, context).getSyncPoller(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 stopExecutionAsync(String resourceGroupName, String jobName, String jobExecutionName) { + return beginStopExecutionAsync(resourceGroupName, jobName, jobExecutionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 stopExecutionAsync( + String resourceGroupName, String jobName, String jobExecutionName, Context context) { + return beginStopExecutionAsync(resourceGroupName, jobName, jobExecutionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 stopExecution(String resourceGroupName, String jobName, String jobExecutionName) { + stopExecutionAsync(resourceGroupName, jobName, jobExecutionName).block(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 stopExecution(String resourceGroupName, String jobName, String jobExecutionName, Context context) { + stopExecutionAsync(resourceGroupName, jobName, jobExecutionName, context).block(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopMultipleExecutionsWithResponseAsync( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); + } else { + jobExecutionName.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopMultipleExecutions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jobName, + jobExecutionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopMultipleExecutionsWithResponseAsync( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobExecutionName == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobExecutionName is required and cannot be null.")); + } else { + jobExecutionName.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopMultipleExecutions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jobName, + jobExecutionName, + accept, + context); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppJobExecutionsInner> + beginStopMultipleExecutionsAsync( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName) { + Mono>> mono = + stopMultipleExecutionsWithResponseAsync(resourceGroupName, jobName, jobExecutionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerAppJobExecutionsInner.class, + ContainerAppJobExecutionsInner.class, + this.client.getContext()); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppJobExecutionsInner> + beginStopMultipleExecutionsAsync( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopMultipleExecutionsWithResponseAsync(resourceGroupName, jobName, jobExecutionName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerAppJobExecutionsInner.class, + ContainerAppJobExecutionsInner.class, + context); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppJobExecutionsInner> + beginStopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName) { + return this.beginStopMultipleExecutionsAsync(resourceGroupName, jobName, jobExecutionName).getSyncPoller(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppJobExecutionsInner> + beginStopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context) { + return this + .beginStopMultipleExecutionsAsync(resourceGroupName, jobName, jobExecutionName, context) + .getSyncPoller(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopMultipleExecutionsAsync( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName) { + return beginStopMultipleExecutionsAsync(resourceGroupName, jobName, jobExecutionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopMultipleExecutionsAsync( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context) { + return beginStopMultipleExecutionsAsync(resourceGroupName, jobName, jobExecutionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppJobExecutionsInner stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName) { + return stopMultipleExecutionsAsync(resourceGroupName, jobName, jobExecutionName).block(); + } + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppJobExecutionsInner stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context) { + return stopMultipleExecutionsAsync(resourceGroupName, jobName, jobExecutionName, context).block(); + } + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String jobName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jobName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSecretsWithResponseAsync( + String resourceGroupName, String jobName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listSecrets( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + jobName, + accept, + context); + } + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync(String resourceGroupName, String jobName) { + return listSecretsWithResponseAsync(resourceGroupName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listSecretsWithResponse( + String resourceGroupName, String jobName, Context context) { + return listSecretsWithResponseAsync(resourceGroupName, jobName, context).block(); + } + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobSecretsCollectionInner listSecrets(String resourceGroupName, String jobName) { + return listSecretsWithResponse(resourceGroupName, jobName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Jobs collection ARM resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Jobs collection ARM resource along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java new file mode 100644 index 0000000000000..e5cc9746895e1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsClientImpl.java @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.appcontainers.fluent.JobsExecutionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in JobsExecutionsClient. */ +public final class JobsExecutionsClientImpl implements JobsExecutionsClient { + /** The proxy service used to perform REST calls. */ + private final JobsExecutionsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of JobsExecutionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobsExecutionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(JobsExecutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientJobsExecutions to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface JobsExecutionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("jobName") String jobName, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String jobName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + filter, + 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 a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String jobName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + jobName, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String jobName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, jobName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String jobName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, jobName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String jobName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, jobName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String jobName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, jobName, filter)); + } + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String jobName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, jobName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.java new file mode 100644 index 0000000000000..ec5d43fa745b5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsExecutionsImpl.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.appcontainers.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.appcontainers.fluent.JobsExecutionsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import com.azure.resourcemanager.appcontainers.models.JobExecution; +import com.azure.resourcemanager.appcontainers.models.JobsExecutions; + +public final class JobsExecutionsImpl implements JobsExecutions { + private static final ClientLogger LOGGER = new ClientLogger(JobsExecutionsImpl.class); + + private final JobsExecutionsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public JobsExecutionsImpl( + JobsExecutionsClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String jobName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, jobName); + return Utils.mapPage(inner, inner1 -> new JobExecutionImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String jobName, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, jobName, filter, context); + return Utils.mapPage(inner, inner1 -> new JobExecutionImpl(inner1, this.manager())); + } + + private JobsExecutionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.java new file mode 100644 index 0000000000000..b1baaaeff51d2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/JobsImpl.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.appcontainers.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.appcontainers.fluent.JobsClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; +import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppJobExecutions; +import com.azure.resourcemanager.appcontainers.models.Job; +import com.azure.resourcemanager.appcontainers.models.JobExecutionBase; +import com.azure.resourcemanager.appcontainers.models.JobExecutionNamesCollection; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import com.azure.resourcemanager.appcontainers.models.JobSecretsCollection; +import com.azure.resourcemanager.appcontainers.models.Jobs; + +public final class JobsImpl implements Jobs { + private static final ClientLogger LOGGER = new ClientLogger(JobsImpl.class); + + private final JobsClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public JobsImpl( + JobsClient innerClient, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new JobImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, jobName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Job getByResourceGroup(String resourceGroupName, String jobName) { + JobInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, jobName); + if (inner != null) { + return new JobImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String jobName) { + this.serviceClient().delete(resourceGroupName, jobName); + } + + public void delete(String resourceGroupName, String jobName, Context context) { + this.serviceClient().delete(resourceGroupName, jobName, context); + } + + public JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template) { + JobExecutionBaseInner inner = this.serviceClient().start(resourceGroupName, jobName, template); + if (inner != null) { + return new JobExecutionBaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public JobExecutionBase start( + String resourceGroupName, String jobName, JobExecutionTemplate template, Context context) { + JobExecutionBaseInner inner = this.serviceClient().start(resourceGroupName, jobName, template, context); + if (inner != null) { + return new JobExecutionBaseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void stopExecution(String resourceGroupName, String jobName, String jobExecutionName) { + this.serviceClient().stopExecution(resourceGroupName, jobName, jobExecutionName); + } + + public void stopExecution(String resourceGroupName, String jobName, String jobExecutionName, Context context) { + this.serviceClient().stopExecution(resourceGroupName, jobName, jobExecutionName, context); + } + + public ContainerAppJobExecutions stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName) { + ContainerAppJobExecutionsInner inner = + this.serviceClient().stopMultipleExecutions(resourceGroupName, jobName, jobExecutionName); + if (inner != null) { + return new ContainerAppJobExecutionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public ContainerAppJobExecutions stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context) { + ContainerAppJobExecutionsInner inner = + this.serviceClient().stopMultipleExecutions(resourceGroupName, jobName, jobExecutionName, context); + if (inner != null) { + return new ContainerAppJobExecutionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listSecretsWithResponse( + String resourceGroupName, String jobName, Context context) { + Response inner = + this.serviceClient().listSecretsWithResponse(resourceGroupName, jobName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new JobSecretsCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public JobSecretsCollection listSecrets(String resourceGroupName, String jobName) { + JobSecretsCollectionInner inner = this.serviceClient().listSecrets(resourceGroupName, jobName); + if (inner != null) { + return new JobSecretsCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Job 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 jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, jobName, 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 jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, jobName, 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 jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + this.delete(resourceGroupName, jobName, 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 jobName = Utils.getValueFromIdByName(id, "jobs"); + if (jobName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'jobs'.", id))); + } + this.delete(resourceGroupName, jobName, context); + } + + private JobsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public JobImpl define(String name) { + return new JobImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.java new file mode 100644 index 0000000000000..678fd7d6c7851 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificateImpl.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.appcontainers.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificate; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificatePatch; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperties; +import java.util.Collections; +import java.util.Map; + +public final class ManagedCertificateImpl + implements ManagedCertificate, ManagedCertificate.Definition, ManagedCertificate.Update { + private ManagedCertificateInner innerObject; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager 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 ManagedCertificateProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagedCertificateInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String environmentName; + + private String managedCertificateName; + + private ManagedCertificatePatch updateManagedCertificateEnvelope; + + public ManagedCertificateImpl withExistingManagedEnvironment(String resourceGroupName, String environmentName) { + this.resourceGroupName = resourceGroupName; + this.environmentName = environmentName; + return this; + } + + public ManagedCertificate create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedCertificates() + .createOrUpdate( + resourceGroupName, environmentName, managedCertificateName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedCertificate create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedCertificates() + .createOrUpdate(resourceGroupName, environmentName, managedCertificateName, this.innerModel(), context); + return this; + } + + ManagedCertificateImpl( + String name, com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = new ManagedCertificateInner(); + this.serviceManager = serviceManager; + this.managedCertificateName = name; + } + + public ManagedCertificateImpl update() { + this.updateManagedCertificateEnvelope = new ManagedCertificatePatch(); + return this; + } + + public ManagedCertificate apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedCertificates() + .updateWithResponse( + resourceGroupName, + environmentName, + managedCertificateName, + updateManagedCertificateEnvelope, + Context.NONE) + .getValue(); + return this; + } + + public ManagedCertificate apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedCertificates() + .updateWithResponse( + resourceGroupName, + environmentName, + managedCertificateName, + updateManagedCertificateEnvelope, + context) + .getValue(); + return this; + } + + ManagedCertificateImpl( + ManagedCertificateInner innerObject, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.environmentName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.managedCertificateName = Utils.getValueFromIdByName(innerObject.id(), "managedCertificates"); + } + + public ManagedCertificate refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedCertificates() + .getWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE) + .getValue(); + return this; + } + + public ManagedCertificate refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedCertificates() + .getWithResponse(resourceGroupName, environmentName, managedCertificateName, context) + .getValue(); + return this; + } + + public ManagedCertificateImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedCertificateImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedCertificateImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateManagedCertificateEnvelope.withTags(tags); + return this; + } + } + + public ManagedCertificateImpl withProperties(ManagedCertificateProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java new file mode 100644 index 0000000000000..73e22fb564193 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesClientImpl.java @@ -0,0 +1,1368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.appcontainers.fluent.ManagedCertificatesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner; +import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateCollection; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificatePatch; +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 ManagedCertificatesClient. */ +public final class ManagedCertificatesClientImpl implements ManagedCertificatesClient { + /** The proxy service used to perform REST calls. */ + private final ManagedCertificatesService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedCertificatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedCertificatesClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(ManagedCertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedCertificates to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + public interface ManagedCertificatesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("managedCertificateName") String managedCertificateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType( + value = ManagementException.class, + code = {400}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("managedCertificateName") String managedCertificateName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedCertificateInner managedCertificateEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("managedCertificateName") String managedCertificateName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @PathParam("managedCertificateName") String managedCertificateName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedCertificatePatch managedCertificateEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("environmentName") String environmentName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String environmentName, String managedCertificateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String environmentName, String managedCertificateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String environmentName, String managedCertificateName) { + return getWithResponseAsync(resourceGroupName, environmentName, managedCertificateName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context) { + return getWithResponseAsync(resourceGroupName, environmentName, managedCertificateName, context).block(); + } + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCertificateInner get( + String resourceGroupName, String environmentName, String managedCertificateName) { + return getWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE).getValue(); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + if (managedCertificateEnvelope != null) { + managedCertificateEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + managedCertificateEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + if (managedCertificateEnvelope != null) { + managedCertificateEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + managedCertificateEnvelope, + accept, + context); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCertificateInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedCertificateInner.class, + ManagedCertificateInner.class, + this.client.getContext()); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCertificateInner> beginCreateOrUpdateAsync( + String resourceGroupName, String environmentName, String managedCertificateName) { + final ManagedCertificateInner managedCertificateEnvelope = null; + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedCertificateInner.class, + ManagedCertificateInner.class, + this.client.getContext()); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedCertificateInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedCertificateInner.class, + ManagedCertificateInner.class, + context); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedCertificateInner> beginCreateOrUpdate( + String resourceGroupName, String environmentName, String managedCertificateName) { + final ManagedCertificateInner managedCertificateEnvelope = null; + return this + .beginCreateOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope) + .getSyncPoller(); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of managed certificates used for Custom Domain bindings of Container + * Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedCertificateInner> beginCreateOrUpdate( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context) { + return this + .beginCreateOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, context) + .getSyncPoller(); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope) { + return beginCreateOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String environmentName, String managedCertificateName) { + final ManagedCertificateInner managedCertificateEnvelope = null; + return beginCreateOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCertificateInner createOrUpdate( + String resourceGroupName, String environmentName, String managedCertificateName) { + final ManagedCertificateInner managedCertificateEnvelope = null; + return createOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope) + .block(); + } + + /** + * Create or Update a Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Managed Certificate to be created or updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws ManagementException thrown if the request is rejected by server on status code 400. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCertificateInner createOrUpdate( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificateInner managedCertificateEnvelope, + Context context) { + return createOrUpdateAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, context) + .block(); + } + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all 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 environmentName, String managedCertificateName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all 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 environmentName, String managedCertificateName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 environmentName, String managedCertificateName) { + return deleteWithResponseAsync(resourceGroupName, environmentName, managedCertificateName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context) { + return deleteWithResponseAsync(resourceGroupName, environmentName, managedCertificateName, context).block(); + } + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if 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 environmentName, String managedCertificateName) { + deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE); + } + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + if (managedCertificateEnvelope == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedCertificateEnvelope is required and cannot be null.")); + } else { + managedCertificateEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + managedCertificateEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + if (managedCertificateName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter managedCertificateName is required and cannot be null.")); + } + if (managedCertificateEnvelope == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedCertificateEnvelope is required and cannot be null.")); + } else { + managedCertificateEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + managedCertificateName, + this.client.getApiVersion(), + managedCertificateEnvelope, + accept, + context); + } + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope) { + return updateWithResponseAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope, + Context context) { + return updateWithResponseAsync( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, context) + .block(); + } + + /** + * Update tags of a managed certificate + * + *

Patches a managed certificate. Oly patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param managedCertificateEnvelope Properties of a managed certificate that need to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedCertificateInner update( + String resourceGroupName, + String environmentName, + String managedCertificateName, + ManagedCertificatePatch managedCertificateEnvelope) { + return updateWithResponse( + resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, Context.NONE) + .getValue(); + } + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String environmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + 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())); + } + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String environmentName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (environmentName == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + environmentName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String environmentName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, environmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String environmentName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, environmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String environmentName) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName)); + } + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String environmentName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, environmentName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

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

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Managed Certificates 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/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java new file mode 100644 index 0000000000000..d20f95e682ae3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedCertificatesImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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.appcontainers.fluent.ManagedCertificatesClient; +import com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificate; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificates; + +public final class ManagedCertificatesImpl implements ManagedCertificates { + private static final ClientLogger LOGGER = new ClientLogger(ManagedCertificatesImpl.class); + + private final ManagedCertificatesClient innerClient; + + private final com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager; + + public ManagedCertificatesImpl( + ManagedCertificatesClient innerClient, + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, environmentName, managedCertificateName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedCertificateImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedCertificate get(String resourceGroupName, String environmentName, String managedCertificateName) { + ManagedCertificateInner inner = + this.serviceClient().get(resourceGroupName, environmentName, managedCertificateName); + if (inner != null) { + return new ManagedCertificateImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, context); + } + + public void delete(String resourceGroupName, String environmentName, String managedCertificateName) { + this.serviceClient().delete(resourceGroupName, environmentName, managedCertificateName); + } + + public PagedIterable list(String resourceGroupName, String environmentName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, environmentName); + return Utils.mapPage(inner, inner1 -> new ManagedCertificateImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String environmentName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, environmentName, context); + return Utils.mapPage(inner, inner1 -> new ManagedCertificateImpl(inner1, this.manager())); + } + + public ManagedCertificate 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String managedCertificateName = Utils.getValueFromIdByName(id, "managedCertificates"); + if (managedCertificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedCertificates'.", id))); + } + return this + .getWithResponse(resourceGroupName, environmentName, managedCertificateName, 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String managedCertificateName = Utils.getValueFromIdByName(id, "managedCertificates"); + if (managedCertificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedCertificates'.", id))); + } + return this.getWithResponse(resourceGroupName, environmentName, managedCertificateName, 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 environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String managedCertificateName = Utils.getValueFromIdByName(id, "managedCertificates"); + if (managedCertificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedCertificates'.", id))); + } + this.deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String environmentName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (environmentName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String managedCertificateName = Utils.getValueFromIdByName(id, "managedCertificates"); + if (managedCertificateName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedCertificates'.", id))); + } + return this.deleteWithResponse(resourceGroupName, environmentName, managedCertificateName, context); + } + + private ManagedCertificatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ManagedCertificateImpl define(String name) { + return new ManagedCertificateImpl(name, this.manager()); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java index 0ece0ae0eada7..9609f44b6edd8 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentDiagnosticsClientImpl.java @@ -55,11 +55,10 @@ public final class ManagedEnvironmentDiagnosticsClientImpl implements ManagedEnv */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ManagedEnvironmentDiagnosticsService { + public interface ManagedEnvironmentDiagnosticsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/detectors") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listDetectors( @@ -73,8 +72,7 @@ Mono> listDetectors( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/detectors/{detectorName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getDetector( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java index 9304a629fcf5d..88ee143090735 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentImpl.java @@ -11,9 +11,10 @@ import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; +import com.azure.resourcemanager.appcontainers.models.DaprConfiguration; import com.azure.resourcemanager.appcontainers.models.EnvironmentAuthToken; import com.azure.resourcemanager.appcontainers.models.EnvironmentProvisioningState; -import com.azure.resourcemanager.appcontainers.models.EnvironmentSkuProperties; +import com.azure.resourcemanager.appcontainers.models.KedaConfiguration; import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; @@ -52,8 +53,8 @@ public Map tags() { } } - public EnvironmentSkuProperties sku() { - return this.innerModel().sku(); + public String kind() { + return this.innerModel().kind(); } public SystemData systemData() { @@ -113,6 +114,18 @@ public List workloadProfiles() { } } + public KedaConfiguration kedaConfiguration() { + return this.innerModel().kedaConfiguration(); + } + + public DaprConfiguration daprConfiguration() { + return this.innerModel().daprConfiguration(); + } + + public String infrastructureResourceGroup() { + return this.innerModel().infrastructureResourceGroup(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -176,7 +189,7 @@ public ManagedEnvironment apply() { serviceManager .serviceClient() .getManagedEnvironments() - .createOrUpdate(resourceGroupName, environmentName, this.innerModel(), Context.NONE); + .update(resourceGroupName, environmentName, this.innerModel(), Context.NONE); return this; } @@ -185,7 +198,7 @@ public ManagedEnvironment apply(Context context) { serviceManager .serviceClient() .getManagedEnvironments() - .createOrUpdate(resourceGroupName, environmentName, this.innerModel(), context); + .update(resourceGroupName, environmentName, this.innerModel(), context); return this; } @@ -243,8 +256,8 @@ public ManagedEnvironmentImpl withTags(Map tags) { return this; } - public ManagedEnvironmentImpl withSku(EnvironmentSkuProperties sku) { - this.innerModel().withSku(sku); + public ManagedEnvironmentImpl withKind(String kind) { + this.innerModel().withKind(kind); return this; } @@ -282,4 +295,19 @@ public ManagedEnvironmentImpl withWorkloadProfiles(List workloa this.innerModel().withWorkloadProfiles(workloadProfiles); return this; } + + public ManagedEnvironmentImpl withKedaConfiguration(KedaConfiguration kedaConfiguration) { + this.innerModel().withKedaConfiguration(kedaConfiguration); + return this; + } + + public ManagedEnvironmentImpl withDaprConfiguration(DaprConfiguration daprConfiguration) { + this.innerModel().withDaprConfiguration(daprConfiguration); + return this; + } + + public ManagedEnvironmentImpl withInfrastructureResourceGroup(String infrastructureResourceGroup) { + this.innerModel().withInfrastructureResourceGroup(infrastructureResourceGroup); + return this; + } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java index 2eeb567c9132b..17ca799512912 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsClientImpl.java @@ -68,7 +68,7 @@ public final class ManagedEnvironmentsClientImpl implements ManagedEnvironmentsC */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ManagedEnvironmentsService { + public interface ManagedEnvironmentsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments") @ExpectedResponses({200}) @@ -82,8 +82,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listByResourceGroup( @@ -96,8 +95,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getByResourceGroup( @@ -111,8 +109,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> createOrUpdate( @@ -127,8 +124,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> delete( @@ -142,9 +138,8 @@ Mono>> delete( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}") - @ExpectedResponses({202}) + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}") + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono>> update( @HostParam("$host") String endpoint, @@ -158,8 +153,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/getAuthtoken") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/getAuthtoken") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getAuthToken( @@ -173,8 +167,7 @@ Mono> getAuthToken( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/workloadProfileStates") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/workloadProfileStates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> listWorkloadProfileStates( @@ -904,7 +897,7 @@ private PollerFlux, ManagedEnvironmentInner> @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - return beginCreateOrUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).getSyncPoller(); } /** @@ -927,7 +920,8 @@ public SyncPoller, ManagedEnvironmentInner> String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, environmentName, environmentEnvelope, context) + return this + .beginCreateOrUpdateAsync(resourceGroupName, environmentName, environmentEnvelope, context) .getSyncPoller(); } @@ -1176,7 +1170,7 @@ private PollerFlux, Void> beginDeleteAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String environmentName) { - return beginDeleteAsync(resourceGroupName, environmentName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, environmentName).getSyncPoller(); } /** @@ -1195,7 +1189,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String environmentName, Context context) { - return beginDeleteAsync(resourceGroupName, environmentName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, environmentName, context).getSyncPoller(); } /** @@ -1281,7 +1275,8 @@ public void delete(String resourceGroupName, String environmentName, Context con * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return an environment for hosting container apps along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1341,7 +1336,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return an environment for hosting container apps along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -1400,17 +1396,21 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync( + private PollerFlux, ManagedEnvironmentInner> beginUpdateAsync( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { Mono>> mono = updateWithResponseAsync(resourceGroupName, environmentName, environmentEnvelope); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedEnvironmentInner.class, + ManagedEnvironmentInner.class, + this.client.getContext()); } /** @@ -1425,10 +1425,10 @@ private PollerFlux, Void> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginUpdateAsync( + private PollerFlux, ManagedEnvironmentInner> beginUpdateAsync( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, @@ -1438,7 +1438,12 @@ private PollerFlux, Void> beginUpdateAsync( updateWithResponseAsync(resourceGroupName, environmentName, environmentEnvelope, context); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedEnvironmentInner.class, + ManagedEnvironmentInner.class, + context); } /** @@ -1452,12 +1457,12 @@ private PollerFlux, Void> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpdate( + public SyncPoller, ManagedEnvironmentInner> beginUpdate( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - return beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope).getSyncPoller(); } /** @@ -1472,15 +1477,15 @@ public SyncPoller, Void> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginUpdate( + public SyncPoller, ManagedEnvironmentInner> beginUpdate( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context) { - return beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope, context).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope, context).getSyncPoller(); } /** @@ -1494,10 +1499,10 @@ public SyncPoller, Void> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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. + * @return an environment for hosting container apps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( + private Mono updateAsync( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { return beginUpdateAsync(resourceGroupName, environmentName, environmentEnvelope) .last() @@ -1516,10 +1521,10 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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. + * @return an environment for hosting container apps on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( + private Mono updateAsync( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, @@ -1540,10 +1545,12 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - updateAsync(resourceGroupName, environmentName, environmentEnvelope).block(); + public ManagedEnvironmentInner update( + String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { + return updateAsync(resourceGroupName, environmentName, environmentEnvelope).block(); } /** @@ -1558,14 +1565,15 @@ public void update(String resourceGroupName, String environmentName, ManagedEnvi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an environment for hosting container apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void update( + public ManagedEnvironmentInner update( String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context) { - updateAsync(resourceGroupName, environmentName, environmentEnvelope, context).block(); + return updateAsync(resourceGroupName, environmentName, environmentEnvelope, context).block(); } /** @@ -1723,17 +1731,17 @@ public EnvironmentAuthTokenInner getAuthToken(String resourceGroupName, String e } /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return all workload Profile States for a Managed Environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWorkloadProfileStatesSinglePageAsync( @@ -1784,9 +1792,9 @@ private Mono> listWorkloadProfileState } /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -1794,8 +1802,8 @@ private Mono> listWorkloadProfileState * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return all workload Profile States for a Managed Environment along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWorkloadProfileStatesSinglePageAsync( @@ -1843,17 +1851,16 @@ private Mono> listWorkloadProfileState } /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedFlux}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listWorkloadProfileStatesAsync( @@ -1864,9 +1871,9 @@ private PagedFlux listWorkloadProfileStatesAsync( } /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -1874,8 +1881,7 @@ private PagedFlux listWorkloadProfileStatesAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedFlux}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listWorkloadProfileStatesAsync( @@ -1886,17 +1892,16 @@ private PagedFlux listWorkloadProfileStatesAsync( } /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedIterable}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listWorkloadProfileStates( @@ -1905,9 +1910,9 @@ public PagedIterable listWorkloadProfileStates( } /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -1915,8 +1920,7 @@ public PagedIterable listWorkloadProfileStates( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedIterable}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listWorkloadProfileStates( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java index 208603d332200..e13f64a584cfb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsDiagnosticsClientImpl.java @@ -54,11 +54,10 @@ public final class ManagedEnvironmentsDiagnosticsClientImpl implements ManagedEn */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ManagedEnvironmentsDiagnosticsService { + public interface ManagedEnvironmentsDiagnosticsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/detectorProperties/rootApi/") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectorProperties/rootApi/") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> getRoot( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java index 19aa83d705b56..80f706e9a89c4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsImpl.java @@ -85,18 +85,6 @@ public void delete(String resourceGroupName, String environmentName, Context con this.serviceClient().delete(resourceGroupName, environmentName, context); } - public void update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope) { - this.serviceClient().update(resourceGroupName, environmentName, environmentEnvelope); - } - - public void update( - String resourceGroupName, - String environmentName, - ManagedEnvironmentInner environmentEnvelope, - Context context) { - this.serviceClient().update(resourceGroupName, environmentName, environmentEnvelope, context); - } - public Response getAuthTokenWithResponse( String resourceGroupName, String environmentName, Context context) { Response inner = diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java index ee07f227ead3b..c92a99ffc179a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ManagedEnvironmentsStoragesClientImpl.java @@ -56,11 +56,10 @@ public final class ManagedEnvironmentsStoragesClientImpl implements ManagedEnvir */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface ManagedEnvironmentsStoragesService { + public interface ManagedEnvironmentsStoragesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/storages") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> list( @@ -74,8 +73,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/storages/{storageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> get( @@ -90,8 +88,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/storages/{storageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> createOrUpdate( @@ -107,8 +104,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/storages/{storageName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> delete( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java index 88bc0b2704a94..0a6fb3fc357bf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/NamespacesClientImpl.java @@ -52,11 +52,10 @@ public final class NamespacesClientImpl implements NamespacesClient { */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface NamespacesService { + public interface NamespacesService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" - + "/managedEnvironments/{environmentName}/checkNameAvailability") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkNameAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) Mono> checkNameAvailability( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java index 951798c3d460d..6f299e42cfedc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/OperationsClientImpl.java @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ContainerAppsApiClie") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.App/operations") @ExpectedResponses({200}) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java index cf34ac0584a5b..a9bb940437705 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/implementation/ReplicaImpl.java @@ -6,6 +6,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner; +import com.azure.resourcemanager.appcontainers.models.ContainerAppReplicaRunningState; import com.azure.resourcemanager.appcontainers.models.Replica; import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; import java.time.OffsetDateTime; @@ -43,6 +44,14 @@ public OffsetDateTime createdTime() { return this.innerModel().createdTime(); } + public ContainerAppReplicaRunningState runningState() { + return this.innerModel().runningState(); + } + + public String runningStateDetails() { + return this.innerModel().runningStateDetails(); + } + public List containers() { List inner = this.innerModel().containers(); if (inner != null) { @@ -52,6 +61,15 @@ public List containers() { } } + public List initContainers() { + List inner = this.innerModel().initContainers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public ReplicaInner innerModel() { return this.innerObject; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java index 8f2d01d44becd..32fca9da968cb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AccessMode.java @@ -16,6 +16,15 @@ public final class AccessMode extends ExpandableStringEnum { /** Static value ReadWrite for AccessMode. */ public static final AccessMode READ_WRITE = fromString("ReadWrite"); + /** + * Creates a new instance of AccessMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessMode() { + } + /** * Creates or finds a AccessMode from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java index 08b42558079c6..03ba2ba32d115 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Action.java @@ -16,6 +16,15 @@ public final class Action extends ExpandableStringEnum { /** Static value Deny for Action. */ public static final Action DENY = fromString("Deny"); + /** + * Creates a new instance of Action value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Action() { + } + /** * Creates or finds a Action from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java index 1ade7f9c0e39e..7084cbc19dc93 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ActiveRevisionsMode.java @@ -21,6 +21,15 @@ public final class ActiveRevisionsMode extends ExpandableStringEnum { + /** Static value sticky for Affinity. */ + public static final Affinity STICKY = fromString("sticky"); + + /** Static value none for Affinity. */ + public static final Affinity NONE = fromString("none"); + + /** + * Creates a new instance of Affinity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Affinity() { + } + + /** + * Creates or finds a Affinity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Affinity. + */ + @JsonCreator + public static Affinity fromString(String name) { + return fromString(name, Affinity.class); + } + + /** + * Gets known Affinity values. + * + * @return known Affinity values. + */ + public static Collection values() { + return values(Affinity.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java index 32c619fd30599..f4c1d5c4844bf 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AppProtocol.java @@ -16,6 +16,15 @@ public final class AppProtocol extends ExpandableStringEnum { /** Static value grpc for AppProtocol. */ public static final AppProtocol GRPC = fromString("grpc"); + /** + * Creates a new instance of AppProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AppProtocol() { + } + /** * Creates or finds a AppProtocol from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java index 5da623ac844af..1eb2343792343 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Applicability.java @@ -16,6 +16,15 @@ public final class Applicability extends ExpandableStringEnum { /** Static value Custom for Applicability. */ public static final Applicability CUSTOM = fromString("Custom"); + /** + * Creates a new instance of Applicability value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Applicability() { + } + /** * Creates or finds a Applicability from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java index 8b06a4146d59b..2960060ee3cfa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/AvailableWorkloadProfileProperties.java @@ -11,10 +11,10 @@ @Fluent public final class AvailableWorkloadProfileProperties { /* - * Used to map workload profile types to billing meter. + * Used to categorize workload profiles. */ - @JsonProperty(value = "billingMeterCategory") - private Category billingMeterCategory; + @JsonProperty(value = "category") + private String category; /* * indicates whether the profile is default for the location. @@ -45,22 +45,22 @@ public AvailableWorkloadProfileProperties() { } /** - * Get the billingMeterCategory property: Used to map workload profile types to billing meter. + * Get the category property: Used to categorize workload profiles. * - * @return the billingMeterCategory value. + * @return the category value. */ - public Category billingMeterCategory() { - return this.billingMeterCategory; + public String category() { + return this.category; } /** - * Set the billingMeterCategory property: Used to map workload profile types to billing meter. + * Set the category property: Used to categorize workload profiles. * - * @param billingMeterCategory the billingMeterCategory value to set. + * @param category the category value to set. * @return the AvailableWorkloadProfileProperties object itself. */ - public AvailableWorkloadProfileProperties withBillingMeterCategory(Category billingMeterCategory) { - this.billingMeterCategory = billingMeterCategory; + public AvailableWorkloadProfileProperties withCategory(String category) { + this.category = category; return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java index 91dbe4dc91946..6de3c755721c5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeter.java @@ -9,7 +9,7 @@ import com.azure.core.management.SystemData; import com.fasterxml.jackson.annotation.JsonProperty; -/** A premium billing meter. */ +/** Billing meter. */ @Fluent public final class BillingMeter extends ProxyResource { /* diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java index d60049b6b205a..00e2c5d0fed52 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BillingMeterProperties.java @@ -11,10 +11,10 @@ @Fluent public final class BillingMeterProperties { /* - * Used to map workload profile types to billing meter. + * Used to categorize billing meters. */ @JsonProperty(value = "category") - private Category category; + private String category; /* * Billing meter type. @@ -33,21 +33,21 @@ public BillingMeterProperties() { } /** - * Get the category property: Used to map workload profile types to billing meter. + * Get the category property: Used to categorize billing meters. * * @return the category value. */ - public Category category() { + public String category() { return this.category; } /** - * Set the category property: Used to map workload profile types to billing meter. + * Set the category property: Used to categorize billing meters. * * @param category the category value to set. * @return the BillingMeterProperties object itself. */ - public BillingMeterProperties withCategory(Category category) { + public BillingMeterProperties withCategory(String category) { this.category = category; return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java index 675cbf07a216a..8e207dccbd689 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/BindingType.java @@ -16,6 +16,15 @@ public final class BindingType extends ExpandableStringEnum { /** Static value SniEnabled for BindingType. */ public static final BindingType SNI_ENABLED = fromString("SniEnabled"); + /** + * Creates a new instance of BindingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BindingType() { + } + /** * Creates or finds a BindingType from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Category.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Category.java deleted file mode 100644 index 0d54e4ba911ae..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Category.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Used to map workload profile types to billing meter. */ -public final class Category extends ExpandableStringEnum { - /** Static value PremiumSkuGeneralPurpose for Category. */ - public static final Category PREMIUM_SKU_GENERAL_PURPOSE = fromString("PremiumSkuGeneralPurpose"); - - /** Static value PremiumSkuMemoryOptimized for Category. */ - public static final Category PREMIUM_SKU_MEMORY_OPTIMIZED = fromString("PremiumSkuMemoryOptimized"); - - /** Static value PremiumSkuComputeOptimized for Category. */ - public static final Category PREMIUM_SKU_COMPUTE_OPTIMIZED = fromString("PremiumSkuComputeOptimized"); - - /** - * Creates or finds a Category from its string representation. - * - * @param name a name to look for. - * @return the corresponding Category. - */ - @JsonCreator - public static Category fromString(String name) { - return fromString(name, Category.class); - } - - /** - * Gets known Category values. - * - * @return known Category values. - */ - public static Collection values() { - return values(Category.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificate.java index d54e84215e265..25177f50653fe 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificate.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Certificate.java @@ -122,13 +122,13 @@ interface WithLocation { /** The stage of the Certificate definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, environmentName. + * Specifies resourceGroupName, connectedEnvironmentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the Connected Environment. * @return the next definition stage. */ - WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + WithCreate withExistingConnectedEnvironment(String resourceGroupName, String connectedEnvironmentName); } /** * The stage of the Certificate definition which contains all the minimum required properties for the resource diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java index af98d56fd8b83..65e92aa12643f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CertificateProvisioningState.java @@ -25,6 +25,15 @@ public final class CertificateProvisioningState extends ExpandableStringEnum getWithResponse( Certificate get(String resourceGroupName, String environmentName, String certificateName); /** - * Deletes the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param certificateName Name of the Certificate. + * @param certificateEnvelope Certificate to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with {@link + * Response}. */ - Response deleteWithResponse( - String resourceGroupName, String environmentName, String certificateName, Context context); + Response createOrUpdateWithResponse( + String resourceGroupName, + String environmentName, + String certificateName, + CertificateInner certificateEnvelope, + Context context); /** - * Deletes the specified Certificate. + * Create or Update a Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -93,63 +100,78 @@ Response deleteWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ - void delete(String resourceGroupName, String environmentName, String certificateName); + Certificate createOrUpdate(String resourceGroupName, String environmentName, String certificateName); /** - * Get the specified Certificate. + * Deletes the specified Certificate. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Certificate along with {@link Response}. + * @return the {@link Response}. */ - Certificate getById(String id); + Response deleteWithResponse( + String resourceGroupName, String environmentName, String certificateName, Context context); /** - * Get the specified Certificate. + * Deletes the specified Certificate. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Certificate along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + void delete(String resourceGroupName, String environmentName, String certificateName); /** - * Deletes the specified Certificate. + * Update properties of a certificate + * + *

Patches a certificate. Currently only patching of tags is supported. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need to be updated. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with {@link + * Response}. */ - void deleteById(String id); + Response updateWithResponse( + String resourceGroupName, + String environmentName, + String certificateName, + CertificatePatch certificateEnvelope, + Context context); /** - * Deletes the specified Certificate. + * Update properties of a certificate * - * @param id the resource ID. - * @param context The context to associate with this operation. + *

Patches a certificate. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param certificateName Name of the Certificate. + * @param certificateEnvelope Properties of a certificate that need to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Certificate resource. - * - * @param name resource name. - * @return the first stage of the new Certificate definition. + * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ - Certificate.DefinitionStages.Blank define(String name); + Certificate update( + String resourceGroupName, String environmentName, String certificateName, CertificatePatch certificateEnvelope); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java index 3a44345d05f54..3913496c6504e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CheckNameAvailabilityReason.java @@ -16,6 +16,15 @@ public final class CheckNameAvailabilityReason extends ExpandableStringEnumChecks if resource connectedEnvironmentName is available. + * + * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityRequest checkNameAvailabilityRequest, Context context); + + /** + * Checks the resource connectedEnvironmentName availability. + * + *

Checks if resource connectedEnvironmentName is available. + * + * @param checkNameAvailabilityRequest The check connectedEnvironmentName availability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the check availability result. + */ + CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest checkNameAvailabilityRequest); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java index cfb4a1c8867cd..19364fb05e732 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentProvisioningState.java @@ -38,6 +38,15 @@ public final class ConnectedEnvironmentProvisioningState /** Static value ScheduledForDelete for ConnectedEnvironmentProvisioningState. */ public static final ConnectedEnvironmentProvisioningState SCHEDULED_FOR_DELETE = fromString("ScheduledForDelete"); + /** + * Creates a new instance of ConnectedEnvironmentProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConnectedEnvironmentProvisioningState() { + } + /** * Creates or finds a ConnectedEnvironmentProvisioningState from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java index e0277e08760b4..86b7664931662 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsCertificates.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; /** Resource collection API of ConnectedEnvironmentsCertificates. */ public interface ConnectedEnvironmentsCertificates { @@ -69,29 +68,23 @@ Response getWithResponse( Certificate get(String resourceGroupName, String connectedEnvironmentName, String certificateName); /** - * Create or Update a Certificate. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. * @param certificateName Name of the Certificate. - * @param certificateEnvelope Certificate to be created or updated. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with {@link - * Response}. + * @return the {@link Response}. */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String connectedEnvironmentName, - String certificateName, - CertificateInner certificateEnvelope, - Context context); + Response deleteWithResponse( + String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context); /** - * Create or Update a Certificate. + * Deletes the specified Certificate. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the Connected Environment. @@ -100,81 +93,63 @@ Response createOrUpdateWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. */ - Certificate createOrUpdate(String resourceGroupName, String connectedEnvironmentName, String certificateName); + void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName); /** - * Deletes the specified Certificate. + * Get the specified Certificate. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. - * @param context The context to associate with this operation. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return the specified Certificate along with {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String connectedEnvironmentName, String certificateName, Context context); + Certificate getById(String id); /** - * Deletes the specified Certificate. + * Get the specified Certificate. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Certificate along with {@link Response}. */ - void delete(String resourceGroupName, String connectedEnvironmentName, String certificateName); + Response getByIdWithResponse(String id, Context context); /** - * Update properties of a certificate - * - *

Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. - * @param context The context to associate with this operation. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment along with {@link - * Response}. */ - Response updateWithResponse( - String resourceGroupName, - String connectedEnvironmentName, - String certificateName, - CertificatePatch certificateEnvelope, - Context context); + void deleteById(String id); /** - * Update properties of a certificate - * - *

Patches a certificate. Currently only patching of tags is supported. + * Deletes the specified Certificate. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the Connected Environment. - * @param certificateName Name of the Certificate. - * @param certificateEnvelope Properties of a certificate that need to be updated. + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return certificate used for Custom Domain bindings of Container Apps in a Managed Environment. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Certificate resource. + * + * @param name resource name. + * @return the first stage of the new Certificate definition. */ - Certificate update( - String resourceGroupName, - String connectedEnvironmentName, - String certificateName, - CertificatePatch certificateEnvelope); + Certificate.DefinitionStages.Blank define(String name); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java index aa40ae8d3ec6e..4e4afa80120f1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ConnectedEnvironmentsDaprComponents.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; /** Resource collection API of ConnectedEnvironmentsDaprComponents. */ public interface ConnectedEnvironmentsDaprComponents { @@ -69,53 +68,40 @@ Response getWithResponse( DaprComponent get(String resourceGroupName, String connectedEnvironmentName, String componentName); /** - * Creates or updates a Dapr Component. + * Delete a Dapr Component. * - *

Creates or updates a Dapr Component in a connected environment. + *

Delete a Dapr Component from a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the connected environment. * @param componentName Name of the Dapr Component. - * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dapr Component along with {@link Response}. + * @return the {@link Response}. */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String connectedEnvironmentName, - String componentName, - DaprComponentInner daprComponentEnvelope, - Context context); + Response deleteWithResponse( + String resourceGroupName, String connectedEnvironmentName, String componentName, Context context); /** - * Creates or updates a Dapr Component. + * Delete a Dapr Component. * - *

Creates or updates a Dapr Component in a connected environment. + *

Delete a Dapr Component from a connected environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the connected environment. * @param componentName Name of the Dapr Component. - * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dapr Component. */ - DaprComponent createOrUpdate( - String resourceGroupName, - String connectedEnvironmentName, - String componentName, - DaprComponentInner daprComponentEnvelope); + void delete(String resourceGroupName, String connectedEnvironmentName, String componentName); /** - * Delete a Dapr Component. - * - *

Delete a Dapr Component from a connected environment. + * List secrets for a dapr component. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the connected environment. @@ -125,15 +111,13 @@ DaprComponent createOrUpdate( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return dapr component Secrets Collection for ListSecrets Action along with {@link Response}. */ - Response deleteWithResponse( + Response listSecretsWithResponse( String resourceGroupName, String connectedEnvironmentName, String componentName, Context context); /** - * Delete a Dapr Component. - * - *

Delete a Dapr Component from a connected environment. + * List secrets for a dapr component. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param connectedEnvironmentName Name of the connected environment. @@ -142,36 +126,68 @@ Response deleteWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr component Secrets Collection for ListSecrets Action. */ - void delete(String resourceGroupName, String connectedEnvironmentName, String componentName); + DaprSecretsCollection listSecrets(String resourceGroupName, String connectedEnvironmentName, String componentName); /** - * List secrets for a dapr component. + * Get a dapr component. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. - * @param componentName Name of the Dapr Component. + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a dapr component along with {@link Response}. + */ + DaprComponent getById(String id); + + /** + * Get a dapr component. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dapr component Secrets Collection for ListSecrets Action along with {@link Response}. + * @return a dapr component along with {@link Response}. */ - Response listSecretsWithResponse( - String resourceGroupName, String connectedEnvironmentName, String componentName, Context context); + Response getByIdWithResponse(String id, Context context); /** - * List secrets for a dapr component. + * Delete a Dapr Component. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param connectedEnvironmentName Name of the connected environment. - * @param componentName Name of the Dapr Component. + *

Delete a Dapr Component from a connected environment. + * + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dapr component Secrets Collection for ListSecrets Action. */ - DaprSecretsCollection listSecrets(String resourceGroupName, String connectedEnvironmentName, String componentName); + void deleteById(String id); + + /** + * Delete a Dapr Component. + * + *

Delete a Dapr Component from a connected environment. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DaprComponent resource. + * + * @param name resource name. + * @return the first stage of the new DaprComponent definition. + */ + DaprComponent.DefinitionStages.Blank define(String name); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java index 58433c0677065..49af3cdd62282 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApp.java @@ -64,6 +64,15 @@ public interface ContainerApp { */ ManagedServiceIdentity identity(); + /** + * Gets the managedBy property: The fully qualified resource ID of the resource that manages this resource. + * Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment + * will not delete the resource if it is removed from the template since it is managed by another resource. + * + * @return the managedBy value. + */ + String managedBy(); + /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -93,11 +102,11 @@ public interface ContainerApp { String environmentId(); /** - * Gets the workloadProfileType property: Workload profile type to pin for container app execution. + * Gets the workloadProfileName property: Workload profile name to pin for container app execution. * - * @return the workloadProfileType value. + * @return the workloadProfileName value. */ - String workloadProfileType(); + String workloadProfileName(); /** * Gets the latestRevisionName property: Name of the latest revision of the Container App. @@ -106,6 +115,13 @@ public interface ContainerApp { */ String latestRevisionName(); + /** + * Gets the latestReadyRevisionName property: Name of the latest ready revision of the Container App. + * + * @return the latestReadyRevisionName value. + */ + String latestReadyRevisionName(); + /** * Gets the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. * @@ -224,9 +240,10 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithExtendedLocation, DefinitionStages.WithIdentity, + DefinitionStages.WithManagedBy, DefinitionStages.WithManagedEnvironmentId, DefinitionStages.WithEnvironmentId, - DefinitionStages.WithWorkloadProfileType, + DefinitionStages.WithWorkloadProfileName, DefinitionStages.WithConfiguration, DefinitionStages.WithTemplate { /** @@ -276,6 +293,21 @@ interface WithIdentity { */ WithCreate withIdentity(ManagedServiceIdentity identity); } + /** The stage of the ContainerApp definition allowing to specify managedBy. */ + interface WithManagedBy { + /** + * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete + * mode deployment will not delete the resource if it is removed from the template since it is managed by + * another resource.. + * + * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if + * this resource is managed by another Azure resource. If this is present, complete mode deployment will + * not delete the resource if it is removed from the template since it is managed by another resource. + * @return the next definition stage. + */ + WithCreate withManagedBy(String managedBy); + } /** The stage of the ContainerApp definition allowing to specify managedEnvironmentId. */ interface WithManagedEnvironmentId { /** @@ -296,15 +328,15 @@ interface WithEnvironmentId { */ WithCreate withEnvironmentId(String environmentId); } - /** The stage of the ContainerApp definition allowing to specify workloadProfileType. */ - interface WithWorkloadProfileType { + /** The stage of the ContainerApp definition allowing to specify workloadProfileName. */ + interface WithWorkloadProfileName { /** - * Specifies the workloadProfileType property: Workload profile type to pin for container app execution.. + * Specifies the workloadProfileName property: Workload profile name to pin for container app execution.. * - * @param workloadProfileType Workload profile type to pin for container app execution. + * @param workloadProfileName Workload profile name to pin for container app execution. * @return the next definition stage. */ - WithCreate withWorkloadProfileType(String workloadProfileType); + WithCreate withWorkloadProfileName(String workloadProfileName); } /** The stage of the ContainerApp definition allowing to specify configuration. */ interface WithConfiguration { @@ -339,7 +371,8 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithExtendedLocation, UpdateStages.WithIdentity, - UpdateStages.WithWorkloadProfileType, + UpdateStages.WithManagedBy, + UpdateStages.WithWorkloadProfileName, UpdateStages.WithConfiguration, UpdateStages.WithTemplate { /** @@ -391,15 +424,30 @@ interface WithIdentity { */ Update withIdentity(ManagedServiceIdentity identity); } - /** The stage of the ContainerApp update allowing to specify workloadProfileType. */ - interface WithWorkloadProfileType { + /** The stage of the ContainerApp update allowing to specify managedBy. */ + interface WithManagedBy { /** - * Specifies the workloadProfileType property: Workload profile type to pin for container app execution.. + * Specifies the managedBy property: The fully qualified resource ID of the resource that manages this + * resource. Indicates if this resource is managed by another Azure resource. If this is present, complete + * mode deployment will not delete the resource if it is removed from the template since it is managed by + * another resource.. * - * @param workloadProfileType Workload profile type to pin for container app execution. + * @param managedBy The fully qualified resource ID of the resource that manages this resource. Indicates if + * this resource is managed by another Azure resource. If this is present, complete mode deployment will + * not delete the resource if it is removed from the template since it is managed by another resource. * @return the next definition stage. */ - Update withWorkloadProfileType(String workloadProfileType); + Update withManagedBy(String managedBy); + } + /** The stage of the ContainerApp update allowing to specify workloadProfileName. */ + interface WithWorkloadProfileName { + /** + * Specifies the workloadProfileName property: Workload profile name to pin for container app execution.. + * + * @param workloadProfileName Workload profile name to pin for container app execution. + * @return the next definition stage. + */ + Update withWorkloadProfileName(String workloadProfileName); } /** The stage of the ContainerApp update allowing to specify configuration. */ interface WithConfiguration { @@ -488,7 +536,10 @@ Response listCustomHostnameAnalysisWithResponse( * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app along with {@link Response}. */ @@ -497,7 +548,10 @@ Response listCustomHostnameAnalysisWithResponse( /** * Get auth token for a container app. * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.java new file mode 100644 index 0000000000000..e70047c568736 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppContainerRunningState.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Current running state of the container. */ +public final class ContainerAppContainerRunningState extends ExpandableStringEnum { + /** Static value Running for ContainerAppContainerRunningState. */ + public static final ContainerAppContainerRunningState RUNNING = fromString("Running"); + + /** Static value Terminated for ContainerAppContainerRunningState. */ + public static final ContainerAppContainerRunningState TERMINATED = fromString("Terminated"); + + /** Static value Waiting for ContainerAppContainerRunningState. */ + public static final ContainerAppContainerRunningState WAITING = fromString("Waiting"); + + /** + * Creates a new instance of ContainerAppContainerRunningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerAppContainerRunningState() { + } + + /** + * Creates or finds a ContainerAppContainerRunningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerAppContainerRunningState. + */ + @JsonCreator + public static ContainerAppContainerRunningState fromString(String name) { + return fromString(name, ContainerAppContainerRunningState.class); + } + + /** + * Gets known ContainerAppContainerRunningState values. + * + * @return known ContainerAppContainerRunningState values. + */ + public static Collection values() { + return values(ContainerAppContainerRunningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.java new file mode 100644 index 0000000000000..126c8b0905436 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppJobExecutions.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.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner; +import java.util.List; + +/** An immutable client-side representation of ContainerAppJobExecutions. */ +public interface ContainerAppJobExecutions { + /** + * Gets the value property: Collection of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppJobExecutionsInner object. + * + * @return the inner object. + */ + ContainerAppJobExecutionsInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java index f1b0dfdbda2e5..f1017da4bd1d0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppProvisioningState.java @@ -25,6 +25,15 @@ public final class ContainerAppProvisioningState extends ExpandableStringEnum { + /** Static value Running for ContainerAppReplicaRunningState. */ + public static final ContainerAppReplicaRunningState RUNNING = fromString("Running"); + + /** Static value NotRunning for ContainerAppReplicaRunningState. */ + public static final ContainerAppReplicaRunningState NOT_RUNNING = fromString("NotRunning"); + + /** Static value Unknown for ContainerAppReplicaRunningState. */ + public static final ContainerAppReplicaRunningState UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of ContainerAppReplicaRunningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ContainerAppReplicaRunningState() { + } + + /** + * Creates or finds a ContainerAppReplicaRunningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerAppReplicaRunningState. + */ + @JsonCreator + public static ContainerAppReplicaRunningState fromString(String name) { + return fromString(name, ContainerAppReplicaRunningState.class); + } + + /** + * Gets known ContainerAppReplicaRunningState values. + * + * @return known ContainerAppReplicaRunningState values. + */ + public static Collection values() { + return values(ContainerAppReplicaRunningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java index 8b238d6111b71..9c65dc9389fef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppSecret.java @@ -22,6 +22,19 @@ public final class ContainerAppSecret { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; + /* + * Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned + * identity. + */ + @JsonProperty(value = "identity", access = JsonProperty.Access.WRITE_ONLY) + private String identity; + + /* + * Azure Key Vault URL pointing to the secret referenced by the container app. + */ + @JsonProperty(value = "keyVaultUrl", access = JsonProperty.Access.WRITE_ONLY) + private String keyVaultUrl; + /** Creates an instance of ContainerAppSecret class. */ public ContainerAppSecret() { } @@ -44,6 +57,25 @@ public String value() { return this.value; } + /** + * Get the identity property: Resource ID of a managed identity to authenticate with Azure Key Vault, or System to + * use a system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Get the keyVaultUrl property: Azure Key Vault URL pointing to the secret referenced by the container app. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + /** * Validates the instance. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApps.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApps.java index f7db26106a58f..c71a0228f1d2b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApps.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerApps.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; /** Resource collection API of ContainerApps. */ public interface ContainerApps { @@ -65,7 +64,10 @@ public interface ContainerApps { * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -78,7 +80,10 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App. */ @@ -109,38 +114,6 @@ Response getByResourceGroupWithResponse( */ void delete(String resourceGroupName, String containerAppName, Context context); - /** - * Update properties of a Container App - * - *

Patches a Container App using JSON Merge Patch. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void update(String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope); - - /** - * Update properties of a Container App - * - *

Patches a Container App using JSON Merge Patch. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param containerAppName Name of the Container App. - * @param containerAppEnvelope Properties of a Container App that need to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void update( - String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context); - /** * Analyzes a custom hostname for a Container App. * @@ -205,7 +178,10 @@ Response listSecretsWithResponse( * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app along with {@link Response}. */ @@ -218,7 +194,10 @@ Response getAuthTokenWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return auth token for a container app. */ @@ -229,7 +208,10 @@ Response getAuthTokenWithResponse( * * @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 com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -241,7 +223,10 @@ Response getAuthTokenWithResponse( * @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 com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java index 977b6d530baaf..5b4e2d2cbc3ac 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ContainerAppsDiagnostics.java @@ -133,7 +133,10 @@ Response getRevisionWithResponse( * @param containerAppName Name of the Container App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App along with {@link Response}. */ @@ -145,7 +148,10 @@ Response getRevisionWithResponse( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param containerAppName Name of the Container App. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server on + * status code 404. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a Container App. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.java new file mode 100644 index 0000000000000..c59afb15a75f6 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CorsPolicy.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cross-Origin-Resource-Sharing policy. */ +@Fluent +public final class CorsPolicy { + /* + * Specifies the content for the access-control-allow-origins header + */ + @JsonProperty(value = "allowedOrigins", required = true) + private List allowedOrigins; + + /* + * Specifies the content for the access-control-allow-methods header + */ + @JsonProperty(value = "allowedMethods") + private List allowedMethods; + + /* + * Specifies the content for the access-control-allow-headers header + */ + @JsonProperty(value = "allowedHeaders") + private List allowedHeaders; + + /* + * Specifies the content for the access-control-expose-headers header + */ + @JsonProperty(value = "exposeHeaders") + private List exposeHeaders; + + /* + * Specifies the content for the access-control-max-age header + */ + @JsonProperty(value = "maxAge") + private Integer maxAge; + + /* + * Specifies whether the resource allows credentials + */ + @JsonProperty(value = "allowCredentials") + private Boolean allowCredentials; + + /** Creates an instance of CorsPolicy class. */ + public CorsPolicy() { + } + + /** + * Get the allowedOrigins property: Specifies the content for the access-control-allow-origins header. + * + * @return the allowedOrigins value. + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: Specifies the content for the access-control-allow-origins header. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Get the allowedMethods property: Specifies the content for the access-control-allow-methods header. + * + * @return the allowedMethods value. + */ + public List allowedMethods() { + return this.allowedMethods; + } + + /** + * Set the allowedMethods property: Specifies the content for the access-control-allow-methods header. + * + * @param allowedMethods the allowedMethods value to set. + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedMethods(List allowedMethods) { + this.allowedMethods = allowedMethods; + return this; + } + + /** + * Get the allowedHeaders property: Specifies the content for the access-control-allow-headers header. + * + * @return the allowedHeaders value. + */ + public List allowedHeaders() { + return this.allowedHeaders; + } + + /** + * Set the allowedHeaders property: Specifies the content for the access-control-allow-headers header. + * + * @param allowedHeaders the allowedHeaders value to set. + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowedHeaders(List allowedHeaders) { + this.allowedHeaders = allowedHeaders; + return this; + } + + /** + * Get the exposeHeaders property: Specifies the content for the access-control-expose-headers header. + * + * @return the exposeHeaders value. + */ + public List exposeHeaders() { + return this.exposeHeaders; + } + + /** + * Set the exposeHeaders property: Specifies the content for the access-control-expose-headers header. + * + * @param exposeHeaders the exposeHeaders value to set. + * @return the CorsPolicy object itself. + */ + public CorsPolicy withExposeHeaders(List exposeHeaders) { + this.exposeHeaders = exposeHeaders; + return this; + } + + /** + * Get the maxAge property: Specifies the content for the access-control-max-age header. + * + * @return the maxAge value. + */ + public Integer maxAge() { + return this.maxAge; + } + + /** + * Set the maxAge property: Specifies the content for the access-control-max-age header. + * + * @param maxAge the maxAge value to set. + * @return the CorsPolicy object itself. + */ + public CorsPolicy withMaxAge(Integer maxAge) { + this.maxAge = maxAge; + return this; + } + + /** + * Get the allowCredentials property: Specifies whether the resource allows credentials. + * + * @return the allowCredentials value. + */ + public Boolean allowCredentials() { + return this.allowCredentials; + } + + /** + * Set the allowCredentials property: Specifies whether the resource allows credentials. + * + * @param allowCredentials the allowCredentials value to set. + * @return the CorsPolicy object itself. + */ + public CorsPolicy withAllowCredentials(Boolean allowCredentials) { + this.allowCredentials = allowCredentials; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (allowedOrigins() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property allowedOrigins in model CorsPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CorsPolicy.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java index c7e9540e075d3..a57a362a886de 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomain.java @@ -26,7 +26,7 @@ public final class CustomDomain { /* * Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment. */ - @JsonProperty(value = "certificateId", required = true) + @JsonProperty(value = "certificateId") private String certificateId; /** Creates an instance of CustomDomain class. */ @@ -106,11 +106,6 @@ public void validate() { .logExceptionAsError( new IllegalArgumentException("Missing required property name in model CustomDomain")); } - if (certificateId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property certificateId in model CustomDomain")); - } } private static final ClientLogger LOGGER = new ClientLogger(CustomDomain.class); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java index 2c403bd755ede..f6d0f7c4eae57 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/CustomDomainConfiguration.java @@ -34,7 +34,7 @@ public final class CustomDomainConfiguration { * Certificate password */ @JsonProperty(value = "certificatePassword") - private byte[] certificatePassword; + private String certificatePassword; /* * Certificate expiration date. @@ -112,8 +112,8 @@ public CustomDomainConfiguration withCertificateValue(byte[] certificateValue) { * * @return the certificatePassword value. */ - public byte[] certificatePassword() { - return CoreUtils.clone(this.certificatePassword); + public String certificatePassword() { + return this.certificatePassword; } /** @@ -122,8 +122,8 @@ public byte[] certificatePassword() { * @param certificatePassword the certificatePassword value to set. * @return the CustomDomainConfiguration object itself. */ - public CustomDomainConfiguration withCertificatePassword(byte[] certificatePassword) { - this.certificatePassword = CoreUtils.clone(certificatePassword); + public CustomDomainConfiguration withCertificatePassword(String certificatePassword) { + this.certificatePassword = certificatePassword; return this; } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java index b8d6168c573d1..68a8bcd7018d0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponent.java @@ -122,13 +122,13 @@ interface Blank extends WithParentResource { /** The stage of the DaprComponent definition allowing to specify parent resource. */ interface WithParentResource { /** - * Specifies resourceGroupName, environmentName. + * Specifies resourceGroupName, connectedEnvironmentName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Managed Environment. + * @param connectedEnvironmentName Name of the connected environment. * @return the next definition stage. */ - WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + WithCreate withExistingConnectedEnvironment(String resourceGroupName, String connectedEnvironmentName); } /** * The stage of the DaprComponent definition which contains all the minimum required properties for the resource diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java index 43295443f0f0b..decfd9343fba5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprComponents.java @@ -7,6 +7,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; /** Resource collection API of DaprComponents. */ public interface DaprComponents { @@ -68,40 +69,53 @@ Response getWithResponse( DaprComponent get(String resourceGroupName, String environmentName, String componentName); /** - * Delete a Dapr Component. + * Creates or updates a Dapr Component. * - *

Delete a Dapr Component from a Managed Environment. + *

Creates or updates a Dapr Component in a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param componentName Name of the Dapr Component. + * @param daprComponentEnvelope Configuration details of the Dapr Component. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return dapr Component along with {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String environmentName, String componentName, Context context); + Response createOrUpdateWithResponse( + String resourceGroupName, + String environmentName, + String componentName, + DaprComponentInner daprComponentEnvelope, + Context context); /** - * Delete a Dapr Component. + * Creates or updates a Dapr Component. * - *

Delete a Dapr Component from a Managed Environment. + *

Creates or updates a Dapr Component in a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. * @param componentName Name of the Dapr Component. + * @param daprComponentEnvelope Configuration details of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr Component. */ - void delete(String resourceGroupName, String environmentName, String componentName); + DaprComponent createOrUpdate( + String resourceGroupName, + String environmentName, + String componentName, + DaprComponentInner daprComponentEnvelope); /** - * List secrets for a dapr component. + * Delete a Dapr Component. + * + *

Delete a Dapr Component from a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -111,13 +125,15 @@ Response deleteWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dapr component Secrets Collection for ListSecrets Action along with {@link Response}. + * @return the {@link Response}. */ - Response listSecretsWithResponse( + Response deleteWithResponse( String resourceGroupName, String environmentName, String componentName, Context context); /** - * List secrets for a dapr component. + * Delete a Dapr Component. + * + *

Delete a Dapr Component from a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -126,68 +142,36 @@ Response listSecretsWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dapr component Secrets Collection for ListSecrets Action. */ - DaprSecretsCollection listSecrets(String resourceGroupName, String environmentName, String componentName); - - /** - * Get a dapr component. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a dapr component along with {@link Response}. - */ - DaprComponent getById(String id); + void delete(String resourceGroupName, String environmentName, String componentName); /** - * Get a dapr component. + * List secrets for a dapr component. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a dapr component along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Dapr Component. - * - *

Delete a Dapr Component from a Managed Environment. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return dapr component Secrets Collection for ListSecrets Action along with {@link Response}. */ - void deleteById(String id); + Response listSecretsWithResponse( + String resourceGroupName, String environmentName, String componentName, Context context); /** - * Delete a Dapr Component. - * - *

Delete a Dapr Component from a Managed Environment. + * List secrets for a dapr component. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param componentName Name of the Dapr Component. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DaprComponent resource. - * - * @param name resource name. - * @return the first stage of the new DaprComponent definition. + * @return dapr component Secrets Collection for ListSecrets Action. */ - DaprComponent.DefinitionStages.Blank define(String name); + DaprSecretsCollection listSecrets(String resourceGroupName, String environmentName, String componentName); } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.java new file mode 100644 index 0000000000000..f0b9ce6544bef --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties Dapr component. */ +@Immutable +public final class DaprConfiguration { + /* + * The version of Dapr + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** Creates an instance of DaprConfiguration class. */ + public DaprConfiguration() { + } + + /** + * Get the version property: The version of Dapr. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.java new file mode 100644 index 0000000000000..54d093bca047c --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecret.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.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dapr component Secret for ListSecrets Action. */ +@Immutable +public final class DaprSecret { + /* + * Secret Name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Secret Value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** Creates an instance of DaprSecret class. */ + public DaprSecret() { + } + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java index 3855936a9a9d7..de12dbb024343 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/DaprSecretsCollection.java @@ -14,7 +14,7 @@ public interface DaprSecretsCollection { * * @return the value value. */ - List value(); + List value(); /** * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner object. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java index aa7e68f3d523f..b7b9a41cdc280 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/EnvironmentProvisioningState.java @@ -43,6 +43,15 @@ public final class EnvironmentProvisioningState extends ExpandableStringEnum ipSecurityRestrictions; + /* + * Sticky Sessions for Single Revision Mode + */ + @JsonProperty(value = "stickySessions") + private IngressStickySessions stickySessions; + + /* + * Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. + * Accept indicates server forwards client certificate but does not require a client certificate. Require indicates + * server requires a client certificate. + */ + @JsonProperty(value = "clientCertificateMode") + private IngressClientCertificateMode clientCertificateMode; + + /* + * CORS policy for container app + */ + @JsonProperty(value = "corsPolicy") + private CorsPolicy corsPolicy; + /** Creates an instance of Ingress class. */ public Ingress() { } @@ -241,6 +261,70 @@ public Ingress withIpSecurityRestrictions(List ipSecu return this; } + /** + * Get the stickySessions property: Sticky Sessions for Single Revision Mode. + * + * @return the stickySessions value. + */ + public IngressStickySessions stickySessions() { + return this.stickySessions; + } + + /** + * Set the stickySessions property: Sticky Sessions for Single Revision Mode. + * + * @param stickySessions the stickySessions value to set. + * @return the Ingress object itself. + */ + public Ingress withStickySessions(IngressStickySessions stickySessions) { + this.stickySessions = stickySessions; + return this; + } + + /** + * Get the clientCertificateMode property: Client certificate mode for mTLS authentication. Ignore indicates server + * drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require + * a client certificate. Require indicates server requires a client certificate. + * + * @return the clientCertificateMode value. + */ + public IngressClientCertificateMode clientCertificateMode() { + return this.clientCertificateMode; + } + + /** + * Set the clientCertificateMode property: Client certificate mode for mTLS authentication. Ignore indicates server + * drops client certificate on forwarding. Accept indicates server forwards client certificate but does not require + * a client certificate. Require indicates server requires a client certificate. + * + * @param clientCertificateMode the clientCertificateMode value to set. + * @return the Ingress object itself. + */ + public Ingress withClientCertificateMode(IngressClientCertificateMode clientCertificateMode) { + this.clientCertificateMode = clientCertificateMode; + return this; + } + + /** + * Get the corsPolicy property: CORS policy for container app. + * + * @return the corsPolicy value. + */ + public CorsPolicy corsPolicy() { + return this.corsPolicy; + } + + /** + * Set the corsPolicy property: CORS policy for container app. + * + * @param corsPolicy the corsPolicy value to set. + * @return the Ingress object itself. + */ + public Ingress withCorsPolicy(CorsPolicy corsPolicy) { + this.corsPolicy = corsPolicy; + return this; + } + /** * Validates the instance. * @@ -256,5 +340,11 @@ public void validate() { if (ipSecurityRestrictions() != null) { ipSecurityRestrictions().forEach(e -> e.validate()); } + if (stickySessions() != null) { + stickySessions().validate(); + } + if (corsPolicy() != null) { + corsPolicy().validate(); + } } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.java new file mode 100644 index 0000000000000..a30b69413bb61 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressClientCertificateMode.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. + * Accept indicates server forwards client certificate but does not require a client certificate. Require indicates + * server requires a client certificate. + */ +public final class IngressClientCertificateMode extends ExpandableStringEnum { + /** Static value ignore for IngressClientCertificateMode. */ + public static final IngressClientCertificateMode IGNORE = fromString("ignore"); + + /** Static value accept for IngressClientCertificateMode. */ + public static final IngressClientCertificateMode ACCEPT = fromString("accept"); + + /** Static value require for IngressClientCertificateMode. */ + public static final IngressClientCertificateMode REQUIRE = fromString("require"); + + /** + * Creates a new instance of IngressClientCertificateMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IngressClientCertificateMode() { + } + + /** + * Creates or finds a IngressClientCertificateMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngressClientCertificateMode. + */ + @JsonCreator + public static IngressClientCertificateMode fromString(String name) { + return fromString(name, IngressClientCertificateMode.class); + } + + /** + * Gets known IngressClientCertificateMode values. + * + * @return known IngressClientCertificateMode values. + */ + public static Collection values() { + return values(IngressClientCertificateMode.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.java new file mode 100644 index 0000000000000..8c4de6b75dfa1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressStickySessions.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sticky Sessions for Single Revision Mode. */ +@Fluent +public final class IngressStickySessions { + /* + * Sticky Session Affinity + */ + @JsonProperty(value = "affinity") + private Affinity affinity; + + /** Creates an instance of IngressStickySessions class. */ + public IngressStickySessions() { + } + + /** + * Get the affinity property: Sticky Session Affinity. + * + * @return the affinity value. + */ + public Affinity affinity() { + return this.affinity; + } + + /** + * Set the affinity property: Sticky Session Affinity. + * + * @param affinity the affinity value to set. + * @return the IngressStickySessions object itself. + */ + public IngressStickySessions withAffinity(Affinity affinity) { + this.affinity = affinity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java index 23fbbd3f6f4d6..15eab472d3d20 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/IngressTransportMethod.java @@ -22,6 +22,15 @@ public final class IngressTransportMethod extends ExpandableStringEnum tags(); + + /** + * Gets the identity property: Managed identities needed by a container app job to interact with other Azure + * services to not maintain any secrets or credentials in code. + * + * @return the identity value. + */ + ManagedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Container Apps Job. + * + * @return the provisioningState value. + */ + JobProvisioningState provisioningState(); + + /** + * Gets the environmentId property: Resource ID of environment. + * + * @return the environmentId value. + */ + String environmentId(); + + /** + * Gets the workloadProfileName property: Workload profile name to pin for container apps job execution. + * + * @return the workloadProfileName value. + */ + String workloadProfileName(); + + /** + * Gets the configuration property: Container Apps Job configuration properties. + * + * @return the configuration value. + */ + JobConfiguration configuration(); + + /** + * Gets the template property: Container Apps job definition. + * + * @return the template value. + */ + JobTemplate template(); + + /** + * Gets the outboundIpAddresses property: Outbound IP Addresses of a container apps job. + * + * @return the outboundIpAddresses value. + */ + List outboundIpAddresses(); + + /** + * Gets the eventStreamEndpoint property: The endpoint of the eventstream of the container apps job. + * + * @return the eventStreamEndpoint value. + */ + String eventStreamEndpoint(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JobInner object. + * + * @return the inner object. + */ + JobInner innerModel(); + + /** The entirety of the Job definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Job definition stages. */ + interface DefinitionStages { + /** The first stage of the Job definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Job 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 Job definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Job definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithEnvironmentId, + DefinitionStages.WithWorkloadProfileName, + DefinitionStages.WithConfiguration, + DefinitionStages.WithTemplate { + /** + * Executes the create request. + * + * @return the created resource. + */ + Job create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Job create(Context context); + } + /** The stage of the Job 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 Job definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identities needed by a container app job to interact with other + * Azure services to not maintain any secrets or credentials in code.. + * + * @param identity Managed identities needed by a container app job to interact with other Azure services to + * not maintain any secrets or credentials in code. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Job definition allowing to specify environmentId. */ + interface WithEnvironmentId { + /** + * Specifies the environmentId property: Resource ID of environment.. + * + * @param environmentId Resource ID of environment. + * @return the next definition stage. + */ + WithCreate withEnvironmentId(String environmentId); + } + /** The stage of the Job definition allowing to specify workloadProfileName. */ + interface WithWorkloadProfileName { + /** + * Specifies the workloadProfileName property: Workload profile name to pin for container apps job + * execution.. + * + * @param workloadProfileName Workload profile name to pin for container apps job execution. + * @return the next definition stage. + */ + WithCreate withWorkloadProfileName(String workloadProfileName); + } + /** The stage of the Job definition allowing to specify configuration. */ + interface WithConfiguration { + /** + * Specifies the configuration property: Container Apps Job configuration properties.. + * + * @param configuration Container Apps Job configuration properties. + * @return the next definition stage. + */ + WithCreate withConfiguration(JobConfiguration configuration); + } + /** The stage of the Job definition allowing to specify template. */ + interface WithTemplate { + /** + * Specifies the template property: Container Apps job definition.. + * + * @param template Container Apps job definition. + * @return the next definition stage. + */ + WithCreate withTemplate(JobTemplate template); + } + } + /** + * Begins update for the Job resource. + * + * @return the stage of resource update. + */ + Job.Update update(); + + /** The template for Job update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Job apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Job apply(Context context); + } + /** The Job update stages. */ + interface UpdateStages { + /** The stage of the Job 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 Job update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed identities needed by a container app job to interact with other + * Azure services to not maintain any secrets or credentials in code.. + * + * @param identity Managed identities needed by a container app job to interact with other Azure services to + * not maintain any secrets or credentials in code. + * @return the next definition stage. + */ + Update withIdentity(ManagedServiceIdentity identity); + } + /** The stage of the Job update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: The properties property.. + * + * @param properties The properties property. + * @return the next definition stage. + */ + Update withProperties(JobPatchPropertiesProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Job refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Job refresh(Context context); + + /** + * Start a Container Apps Job. + * + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + JobExecutionBase start(JobExecutionTemplate template); + + /** + * Start a Container Apps Job. + * + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + JobExecutionBase start(JobExecutionTemplate template, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + ContainerAppJobExecutions stopMultipleExecutions(JobExecutionNamesCollection jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + ContainerAppJobExecutions stopMultipleExecutions(JobExecutionNamesCollection jobExecutionName, Context context); + + /** + * List secrets for a container apps job. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + */ + Response listSecretsWithResponse(Context context); + + /** + * List secrets for a container apps job. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource. + */ + JobSecretsCollection listSecrets(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.java new file mode 100644 index 0000000000000..350c04b172573 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Non versioned Container Apps Job configuration properties. */ +@Fluent +public final class JobConfiguration { + /* + * Collection of secrets used by a Container Apps Job + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Trigger type of the job + */ + @JsonProperty(value = "triggerType", required = true) + private TriggerType triggerType; + + /* + * Maximum number of seconds a replica is allowed to run. + */ + @JsonProperty(value = "replicaTimeout", required = true) + private int replicaTimeout; + + /* + * Maximum number of retries before failing the job. + */ + @JsonProperty(value = "replicaRetryLimit") + private Integer replicaRetryLimit; + + /* + * Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would + * be set to 1 by default + */ + @JsonProperty(value = "manualTriggerConfig") + private JobConfigurationManualTriggerConfig manualTriggerConfig; + + /* + * Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties completions and parallelism + * would be set to 1 by default + */ + @JsonProperty(value = "scheduleTriggerConfig") + private JobConfigurationScheduleTriggerConfig scheduleTriggerConfig; + + /* + * Collection of private container registry credentials used by a Container apps job + */ + @JsonProperty(value = "registries") + private List registries; + + /** Creates an instance of JobConfiguration class. */ + public JobConfiguration() { + } + + /** + * Get the secrets property: Collection of secrets used by a Container Apps Job. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Collection of secrets used by a Container Apps Job. + * + * @param secrets the secrets value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the triggerType property: Trigger type of the job. + * + * @return the triggerType value. + */ + public TriggerType triggerType() { + return this.triggerType; + } + + /** + * Set the triggerType property: Trigger type of the job. + * + * @param triggerType the triggerType value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withTriggerType(TriggerType triggerType) { + this.triggerType = triggerType; + return this; + } + + /** + * Get the replicaTimeout property: Maximum number of seconds a replica is allowed to run. + * + * @return the replicaTimeout value. + */ + public int replicaTimeout() { + return this.replicaTimeout; + } + + /** + * Set the replicaTimeout property: Maximum number of seconds a replica is allowed to run. + * + * @param replicaTimeout the replicaTimeout value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withReplicaTimeout(int replicaTimeout) { + this.replicaTimeout = replicaTimeout; + return this; + } + + /** + * Get the replicaRetryLimit property: Maximum number of retries before failing the job. + * + * @return the replicaRetryLimit value. + */ + public Integer replicaRetryLimit() { + return this.replicaRetryLimit; + } + + /** + * Set the replicaRetryLimit property: Maximum number of retries before failing the job. + * + * @param replicaRetryLimit the replicaRetryLimit value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withReplicaRetryLimit(Integer replicaRetryLimit) { + this.replicaRetryLimit = replicaRetryLimit; + return this; + } + + /** + * Get the manualTriggerConfig property: Manual trigger configuration for a single execution job. Properties + * replicaCompletionCount and parallelism would be set to 1 by default. + * + * @return the manualTriggerConfig value. + */ + public JobConfigurationManualTriggerConfig manualTriggerConfig() { + return this.manualTriggerConfig; + } + + /** + * Set the manualTriggerConfig property: Manual trigger configuration for a single execution job. Properties + * replicaCompletionCount and parallelism would be set to 1 by default. + * + * @param manualTriggerConfig the manualTriggerConfig value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withManualTriggerConfig(JobConfigurationManualTriggerConfig manualTriggerConfig) { + this.manualTriggerConfig = manualTriggerConfig; + return this; + } + + /** + * Get the scheduleTriggerConfig property: Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. + * Properties completions and parallelism would be set to 1 by default. + * + * @return the scheduleTriggerConfig value. + */ + public JobConfigurationScheduleTriggerConfig scheduleTriggerConfig() { + return this.scheduleTriggerConfig; + } + + /** + * Set the scheduleTriggerConfig property: Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. + * Properties completions and parallelism would be set to 1 by default. + * + * @param scheduleTriggerConfig the scheduleTriggerConfig value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withScheduleTriggerConfig(JobConfigurationScheduleTriggerConfig scheduleTriggerConfig) { + this.scheduleTriggerConfig = scheduleTriggerConfig; + return this; + } + + /** + * Get the registries property: Collection of private container registry credentials used by a Container apps job. + * + * @return the registries value. + */ + public List registries() { + return this.registries; + } + + /** + * Set the registries property: Collection of private container registry credentials used by a Container apps job. + * + * @param registries the registries value to set. + * @return the JobConfiguration object itself. + */ + public JobConfiguration withRegistries(List registries) { + this.registries = registries; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } + if (triggerType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property triggerType in model JobConfiguration")); + } + if (manualTriggerConfig() != null) { + manualTriggerConfig().validate(); + } + if (scheduleTriggerConfig() != null) { + scheduleTriggerConfig().validate(); + } + if (registries() != null) { + registries().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobConfiguration.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.java new file mode 100644 index 0000000000000..64bd76c836273 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationManualTriggerConfig.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be + * set to 1 by default. + */ +@Fluent +public final class JobConfigurationManualTriggerConfig { + /* + * Minimum number of successful replica completions before overall job completion. + */ + @JsonProperty(value = "replicaCompletionCount") + private Integer replicaCompletionCount; + + /* + * Number of parallel replicas of a job that can run at a given time. + */ + @JsonProperty(value = "parallelism") + private Integer parallelism; + + /** Creates an instance of JobConfigurationManualTriggerConfig class. */ + public JobConfigurationManualTriggerConfig() { + } + + /** + * Get the replicaCompletionCount property: Minimum number of successful replica completions before overall job + * completion. + * + * @return the replicaCompletionCount value. + */ + public Integer replicaCompletionCount() { + return this.replicaCompletionCount; + } + + /** + * Set the replicaCompletionCount property: Minimum number of successful replica completions before overall job + * completion. + * + * @param replicaCompletionCount the replicaCompletionCount value to set. + * @return the JobConfigurationManualTriggerConfig object itself. + */ + public JobConfigurationManualTriggerConfig withReplicaCompletionCount(Integer replicaCompletionCount) { + this.replicaCompletionCount = replicaCompletionCount; + return this; + } + + /** + * Get the parallelism property: Number of parallel replicas of a job that can run at a given time. + * + * @return the parallelism value. + */ + public Integer parallelism() { + return this.parallelism; + } + + /** + * Set the parallelism property: Number of parallel replicas of a job that can run at a given time. + * + * @param parallelism the parallelism value to set. + * @return the JobConfigurationManualTriggerConfig object itself. + */ + public JobConfigurationManualTriggerConfig withParallelism(Integer parallelism) { + this.parallelism = parallelism; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.java new file mode 100644 index 0000000000000..69435efd237d0 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobConfigurationScheduleTriggerConfig.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties completions and parallelism would be + * set to 1 by default. + */ +@Fluent +public final class JobConfigurationScheduleTriggerConfig { + /* + * Minimum number of successful replica completions before overall job completion. + */ + @JsonProperty(value = "replicaCompletionCount") + private Integer replicaCompletionCount; + + /* + * Cron formatted repeating schedule ("* * * * *") of a Cron Job. + */ + @JsonProperty(value = "cronExpression", required = true) + private String cronExpression; + + /* + * Number of parallel replicas of a job that can run at a given time. + */ + @JsonProperty(value = "parallelism") + private Integer parallelism; + + /** Creates an instance of JobConfigurationScheduleTriggerConfig class. */ + public JobConfigurationScheduleTriggerConfig() { + } + + /** + * Get the replicaCompletionCount property: Minimum number of successful replica completions before overall job + * completion. + * + * @return the replicaCompletionCount value. + */ + public Integer replicaCompletionCount() { + return this.replicaCompletionCount; + } + + /** + * Set the replicaCompletionCount property: Minimum number of successful replica completions before overall job + * completion. + * + * @param replicaCompletionCount the replicaCompletionCount value to set. + * @return the JobConfigurationScheduleTriggerConfig object itself. + */ + public JobConfigurationScheduleTriggerConfig withReplicaCompletionCount(Integer replicaCompletionCount) { + this.replicaCompletionCount = replicaCompletionCount; + return this; + } + + /** + * Get the cronExpression property: Cron formatted repeating schedule ("* * * * *") of a Cron Job. + * + * @return the cronExpression value. + */ + public String cronExpression() { + return this.cronExpression; + } + + /** + * Set the cronExpression property: Cron formatted repeating schedule ("* * * * *") of a Cron Job. + * + * @param cronExpression the cronExpression value to set. + * @return the JobConfigurationScheduleTriggerConfig object itself. + */ + public JobConfigurationScheduleTriggerConfig withCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + return this; + } + + /** + * Get the parallelism property: Number of parallel replicas of a job that can run at a given time. + * + * @return the parallelism value. + */ + public Integer parallelism() { + return this.parallelism; + } + + /** + * Set the parallelism property: Number of parallel replicas of a job that can run at a given time. + * + * @param parallelism the parallelism value to set. + * @return the JobConfigurationScheduleTriggerConfig object itself. + */ + public JobConfigurationScheduleTriggerConfig withParallelism(Integer parallelism) { + this.parallelism = parallelism; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cronExpression() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property cronExpression in model JobConfigurationScheduleTriggerConfig")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobConfigurationScheduleTriggerConfig.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java new file mode 100644 index 0000000000000..4439c74df2cfd --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecution.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of JobExecution. */ +public interface JobExecution { + /** + * Gets the name property: Job execution Name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Job execution Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the type property: Job Type. + * + * @return the type value. + */ + String type(); + + /** + * Gets the status property: Current running State of the job. + * + * @return the status value. + */ + JobExecutionRunningState status(); + + /** + * Gets the startTime property: Job execution start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: Job execution start time. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the template property: Job's execution container. + * + * @return the template value. + */ + JobExecutionTemplate template(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionInner object. + * + * @return the inner object. + */ + JobExecutionInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionBase.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionBase.java new file mode 100644 index 0000000000000..fb4caf902bb2f --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionBase.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.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; + +/** An immutable client-side representation of JobExecutionBase. */ +public interface JobExecutionBase { + /** + * Gets the name property: Job execution name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the id property: Job execution Id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner object. + * + * @return the inner object. + */ + JobExecutionBaseInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java new file mode 100644 index 0000000000000..dea126fc397cc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionContainer.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container Apps Jobs execution container definition. */ +@Fluent +public final class JobExecutionContainer { + /* + * Container image tag. + */ + @JsonProperty(value = "image") + private String image; + + /* + * Custom container name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Container start command. + */ + @JsonProperty(value = "command") + private List command; + + /* + * Container start command arguments. + */ + @JsonProperty(value = "args") + private List args; + + /* + * Container environment variables. + */ + @JsonProperty(value = "env") + private List env; + + /* + * Container resource requirements. + */ + @JsonProperty(value = "resources") + private ContainerResources resources; + + /** Creates an instance of JobExecutionContainer class. */ + public JobExecutionContainer() { + } + + /** + * Get the image property: Container image tag. + * + * @return the image value. + */ + public String image() { + return this.image; + } + + /** + * Set the image property: Container image tag. + * + * @param image the image value to set. + * @return the JobExecutionContainer object itself. + */ + public JobExecutionContainer withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the name property: Custom container name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Custom container name. + * + * @param name the name value to set. + * @return the JobExecutionContainer object itself. + */ + public JobExecutionContainer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the command property: Container start command. + * + * @return the command value. + */ + public List command() { + return this.command; + } + + /** + * Set the command property: Container start command. + * + * @param command the command value to set. + * @return the JobExecutionContainer object itself. + */ + public JobExecutionContainer withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the args property: Container start command arguments. + * + * @return the args value. + */ + public List args() { + return this.args; + } + + /** + * Set the args property: Container start command arguments. + * + * @param args the args value to set. + * @return the JobExecutionContainer object itself. + */ + public JobExecutionContainer withArgs(List args) { + this.args = args; + return this; + } + + /** + * Get the env property: Container environment variables. + * + * @return the env value. + */ + public List env() { + return this.env; + } + + /** + * Set the env property: Container environment variables. + * + * @param env the env value to set. + * @return the JobExecutionContainer object itself. + */ + public JobExecutionContainer withEnv(List env) { + this.env = env; + return this; + } + + /** + * Get the resources property: Container resource requirements. + * + * @return the resources value. + */ + public ContainerResources resources() { + return this.resources; + } + + /** + * Set the resources property: Container resource requirements. + * + * @param resources the resources value to set. + * @return the JobExecutionContainer object itself. + */ + public JobExecutionContainer withResources(ContainerResources resources) { + this.resources = resources; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (env() != null) { + env().forEach(e -> e.validate()); + } + if (resources() != null) { + resources().validate(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionNamesCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionNamesCollection.java new file mode 100644 index 0000000000000..194c4607d0458 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionNamesCollection.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App executions names list. */ +@Fluent +public final class JobExecutionNamesCollection { + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** Creates an instance of JobExecutionNamesCollection class. */ + public JobExecutionNamesCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the JobExecutionNamesCollection object itself. + */ + public JobExecutionNamesCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model JobExecutionNamesCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobExecutionNamesCollection.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java new file mode 100644 index 0000000000000..d10e8261d16c5 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionRunningState.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Current running State of the job. */ +public final class JobExecutionRunningState extends ExpandableStringEnum { + /** Static value Running for JobExecutionRunningState. */ + public static final JobExecutionRunningState RUNNING = fromString("Running"); + + /** Static value Processing for JobExecutionRunningState. */ + public static final JobExecutionRunningState PROCESSING = fromString("Processing"); + + /** Static value Stopped for JobExecutionRunningState. */ + public static final JobExecutionRunningState STOPPED = fromString("Stopped"); + + /** Static value Degraded for JobExecutionRunningState. */ + public static final JobExecutionRunningState DEGRADED = fromString("Degraded"); + + /** Static value Failed for JobExecutionRunningState. */ + public static final JobExecutionRunningState FAILED = fromString("Failed"); + + /** Static value Unknown for JobExecutionRunningState. */ + public static final JobExecutionRunningState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for JobExecutionRunningState. */ + public static final JobExecutionRunningState SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of JobExecutionRunningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobExecutionRunningState() { + } + + /** + * Creates or finds a JobExecutionRunningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobExecutionRunningState. + */ + @JsonCreator + public static JobExecutionRunningState fromString(String name) { + return fromString(name, JobExecutionRunningState.class); + } + + /** + * Gets known JobExecutionRunningState values. + * + * @return known JobExecutionRunningState values. + */ + public static Collection values() { + return values(JobExecutionRunningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.java new file mode 100644 index 0000000000000..eec1fda1387a2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobExecutionTemplate.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Job's execution template, containing container configuration for a job's execution. */ +@Fluent +public final class JobExecutionTemplate { + /* + * List of container definitions for the Container Apps Job. + */ + @JsonProperty(value = "containers") + private List containers; + + /* + * List of specialized containers that run before job containers. + */ + @JsonProperty(value = "initContainers") + private List initContainers; + + /** Creates an instance of JobExecutionTemplate class. */ + public JobExecutionTemplate() { + } + + /** + * Get the containers property: List of container definitions for the Container Apps Job. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: List of container definitions for the Container Apps Job. + * + * @param containers the containers value to set. + * @return the JobExecutionTemplate object itself. + */ + public JobExecutionTemplate withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the initContainers property: List of specialized containers that run before job containers. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: List of specialized containers that run before job containers. + * + * @param initContainers the initContainers value to set. + * @return the JobExecutionTemplate object itself. + */ + public JobExecutionTemplate withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.java new file mode 100644 index 0000000000000..dddbf57dd6ac1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchProperties.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Container Apps Job resource specific properties. */ +@Fluent +public final class JobPatchProperties { + /* + * Managed identities needed by a container app job to interact with other Azure services to not maintain any + * secrets or credentials in code. + */ + @JsonProperty(value = "identity") + private ManagedServiceIdentity identity; + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * The properties property. + */ + @JsonProperty(value = "properties") + private JobPatchPropertiesProperties properties; + + /** Creates an instance of JobPatchProperties class. */ + public JobPatchProperties() { + } + + /** + * Get the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identities needed by a container app job to interact with other Azure services + * to not maintain any secrets or credentials in code. + * + * @param identity the identity value to set. + * @return the JobPatchProperties object itself. + */ + public JobPatchProperties withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the JobPatchProperties object itself. + */ + public JobPatchProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public JobPatchPropertiesProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties property. + * + * @param properties the properties value to set. + * @return the JobPatchProperties object itself. + */ + public JobPatchProperties withProperties(JobPatchPropertiesProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java new file mode 100644 index 0000000000000..246e0a88c0d0b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobPatchPropertiesProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The JobPatchPropertiesProperties model. */ +@Fluent +public final class JobPatchPropertiesProperties { + /* + * Resource ID of environment. + */ + @JsonProperty(value = "environmentId") + private String environmentId; + + /* + * Container Apps Job configuration properties. + */ + @JsonProperty(value = "configuration") + private JobConfiguration configuration; + + /* + * Container Apps job definition. + */ + @JsonProperty(value = "template") + private JobTemplate template; + + /* + * Outbound IP Addresses of a container apps job. + */ + @JsonProperty(value = "outboundIpAddresses") + private List outboundIpAddresses; + + /* + * The endpoint of the eventstream of the container apps job. + */ + @JsonProperty(value = "eventStreamEndpoint") + private String eventStreamEndpoint; + + /** Creates an instance of JobPatchPropertiesProperties class. */ + public JobPatchPropertiesProperties() { + } + + /** + * Get the environmentId property: Resource ID of environment. + * + * @return the environmentId value. + */ + public String environmentId() { + return this.environmentId; + } + + /** + * Set the environmentId property: Resource ID of environment. + * + * @param environmentId the environmentId value to set. + * @return the JobPatchPropertiesProperties object itself. + */ + public JobPatchPropertiesProperties withEnvironmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Get the configuration property: Container Apps Job configuration properties. + * + * @return the configuration value. + */ + public JobConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Container Apps Job configuration properties. + * + * @param configuration the configuration value to set. + * @return the JobPatchPropertiesProperties object itself. + */ + public JobPatchPropertiesProperties withConfiguration(JobConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the template property: Container Apps job definition. + * + * @return the template value. + */ + public JobTemplate template() { + return this.template; + } + + /** + * Set the template property: Container Apps job definition. + * + * @param template the template value to set. + * @return the JobPatchPropertiesProperties object itself. + */ + public JobPatchPropertiesProperties withTemplate(JobTemplate template) { + this.template = template; + return this; + } + + /** + * Get the outboundIpAddresses property: Outbound IP Addresses of a container apps job. + * + * @return the outboundIpAddresses value. + */ + public List outboundIpAddresses() { + return this.outboundIpAddresses; + } + + /** + * Set the outboundIpAddresses property: Outbound IP Addresses of a container apps job. + * + * @param outboundIpAddresses the outboundIpAddresses value to set. + * @return the JobPatchPropertiesProperties object itself. + */ + public JobPatchPropertiesProperties withOutboundIpAddresses(List outboundIpAddresses) { + this.outboundIpAddresses = outboundIpAddresses; + return this; + } + + /** + * Get the eventStreamEndpoint property: The endpoint of the eventstream of the container apps job. + * + * @return the eventStreamEndpoint value. + */ + public String eventStreamEndpoint() { + return this.eventStreamEndpoint; + } + + /** + * Set the eventStreamEndpoint property: The endpoint of the eventstream of the container apps job. + * + * @param eventStreamEndpoint the eventStreamEndpoint value to set. + * @return the JobPatchPropertiesProperties object itself. + */ + public JobPatchPropertiesProperties withEventStreamEndpoint(String eventStreamEndpoint) { + this.eventStreamEndpoint = eventStreamEndpoint; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (configuration() != null) { + configuration().validate(); + } + if (template() != null) { + template().validate(); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.java new file mode 100644 index 0000000000000..36f82edc4b8cf --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobProvisioningState.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Provisioning state of the Container Apps Job. */ +public final class JobProvisioningState extends ExpandableStringEnum { + /** Static value InProgress for JobProvisioningState. */ + public static final JobProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for JobProvisioningState. */ + public static final JobProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for JobProvisioningState. */ + public static final JobProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for JobProvisioningState. */ + public static final JobProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Deleting for JobProvisioningState. */ + public static final JobProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of JobProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobProvisioningState() { + } + + /** + * Creates or finds a JobProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobProvisioningState. + */ + @JsonCreator + public static JobProvisioningState fromString(String name) { + return fromString(name, JobProvisioningState.class); + } + + /** + * Gets known JobProvisioningState values. + * + * @return known JobProvisioningState values. + */ + public static Collection values() { + return values(JobProvisioningState.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.java new file mode 100644 index 0000000000000..89a553df4015b --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobSecretsCollection.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.appcontainers.models; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner; +import java.util.List; + +/** An immutable client-side representation of JobSecretsCollection. */ +public interface JobSecretsCollection { + /** + * Gets the value property: Collection of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.JobSecretsCollectionInner object. + * + * @return the inner object. + */ + JobSecretsCollectionInner innerModel(); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java new file mode 100644 index 0000000000000..ca61cdb3f88be --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobTemplate.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Container Apps Job versioned application definition. Defines the desired state of an immutable revision. Any changes + * to this section Will result in a new revision being created. + */ +@Fluent +public final class JobTemplate { + /* + * List of specialized containers that run before app containers. + */ + @JsonProperty(value = "initContainers") + private List initContainers; + + /* + * List of container definitions for the Container App. + */ + @JsonProperty(value = "containers") + private List containers; + + /* + * List of volume definitions for the Container App. + */ + @JsonProperty(value = "volumes") + private List volumes; + + /** Creates an instance of JobTemplate class. */ + public JobTemplate() { + } + + /** + * Get the initContainers property: List of specialized containers that run before app containers. + * + * @return the initContainers value. + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the initContainers property: List of specialized containers that run before app containers. + * + * @param initContainers the initContainers value to set. + * @return the JobTemplate object itself. + */ + public JobTemplate withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + + /** + * Get the containers property: List of container definitions for the Container App. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: List of container definitions for the Container App. + * + * @param containers the containers value to set. + * @return the JobTemplate object itself. + */ + public JobTemplate withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the volumes property: List of volume definitions for the Container App. + * + * @return the volumes value. + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the volumes property: List of volume definitions for the Container App. + * + * @param volumes the volumes value to set. + * @return the JobTemplate object itself. + */ + public JobTemplate withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (initContainers() != null) { + initContainers().forEach(e -> e.validate()); + } + if (containers() != null) { + containers().forEach(e -> e.validate()); + } + if (volumes() != null) { + volumes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java new file mode 100644 index 0000000000000..98c5fb30bb4d1 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Jobs.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.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 Jobs. */ +public interface Jobs { + /** + * Get the Container Apps Jobs in a given subscription. + * + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Get the Container Apps Jobs in a given subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the Container Apps Jobs in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Container Apps Jobs in a given resource group as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String jobName, Context context); + + /** + * Get the properties of a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job. + */ + Job getByResourceGroup(String resourceGroupName, String jobName); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 jobName); + + /** + * Delete a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 jobName, Context context); + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template); + + /** + * Start a Container Apps Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param template Properties used to start a job instance. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App's Job execution name. + */ + JobExecutionBase start(String resourceGroupName, String jobName, JobExecutionTemplate template, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopExecution(String resourceGroupName, String jobName, String jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName Job execution name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stopExecution(String resourceGroupName, String jobName, String jobExecutionName, Context context); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + ContainerAppJobExecutions stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName); + + /** + * Terminates execution of a running container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param jobExecutionName List of all job executions that should be stopped. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container App executions collection ARM resource. + */ + ContainerAppJobExecutions stopMultipleExecutions( + String resourceGroupName, String jobName, JobExecutionNamesCollection jobExecutionName, Context context); + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource along with {@link Response}. + */ + Response listSecretsWithResponse(String resourceGroupName, String jobName, Context context); + + /** + * List secrets for a container apps job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return container Apps Job Secrets Collection ARM resource. + */ + JobSecretsCollection listSecrets(String resourceGroupName, String jobName); + + /** + * Get the properties of a Container Apps Job. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response}. + */ + Job getById(String id); + + /** + * Get the properties of a Container Apps Job. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container Apps Job along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Container Apps Job. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Container Apps Job. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 Job resource. + * + * @param name resource name. + * @return the first stage of the new Job definition. + */ + Job.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.java new file mode 100644 index 0000000000000..40f2582ca10ed --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsCollection.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.models.JobInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container Apps Jobs collection ARM resource. */ +@Fluent +public final class JobsCollection { + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of JobsCollection class. */ + public JobsCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the JobsCollection object itself. + */ + public JobsCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model JobsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(JobsCollection.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.java new file mode 100644 index 0000000000000..2fecb73b3db64 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/JobsExecutions.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.appcontainers.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of JobsExecutions. */ +public interface JobsExecutions { + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String jobName); + + /** + * Get a Container Apps Job's executions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param jobName Name of the Container Apps Job. + * @param filter The filter to apply on the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Container Apps Job's executions as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String jobName, String filter, Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.java new file mode 100644 index 0000000000000..0641d83247184 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/KedaConfiguration.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.appcontainers.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties Keda component. */ +@Immutable +public final class KedaConfiguration { + /* + * The version of Keda + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** Creates an instance of KedaConfiguration class. */ + public KedaConfiguration() { + } + + /** + * Get the version property: The version of Keda. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java index cd0a46df20da9..10288186ff842 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/LogLevel.java @@ -22,6 +22,15 @@ public final class LogLevel extends ExpandableStringEnum { /** Static value error for LogLevel. */ public static final LogLevel ERROR = fromString("error"); + /** + * Creates a new instance of LogLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LogLevel() { + } + /** * Creates or finds a LogLevel from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.java new file mode 100644 index 0000000000000..00bc8882ee3da --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificate.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.appcontainers.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedCertificate. */ +public interface ManagedCertificate { + /** + * 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: Certificate resource specific properties. + * + * @return the properties value. + */ + ManagedCertificateProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner object. + * + * @return the inner object. + */ + ManagedCertificateInner innerModel(); + + /** The entirety of the ManagedCertificate definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The ManagedCertificate definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedCertificate definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedCertificate 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the ManagedCertificate definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, environmentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String environmentName); + } + /** + * The stage of the ManagedCertificate 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 { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedCertificate create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedCertificate create(Context context); + } + /** The stage of the ManagedCertificate 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 ManagedCertificate definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Certificate resource specific properties. + * + * @param properties Certificate resource specific properties. + * @return the next definition stage. + */ + WithCreate withProperties(ManagedCertificateProperties properties); + } + } + /** + * Begins update for the ManagedCertificate resource. + * + * @return the stage of resource update. + */ + ManagedCertificate.Update update(); + + /** The template for ManagedCertificate update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedCertificate apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedCertificate apply(Context context); + } + /** The ManagedCertificate update stages. */ + interface UpdateStages { + /** The stage of the ManagedCertificate update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Application-specific metadata in the form of key-value pairs.. + * + * @param tags Application-specific metadata in the form of key-value pairs. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedCertificate refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedCertificate refresh(Context context); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.java new file mode 100644 index 0000000000000..5f331c81666df --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateCollection.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.appcontainers.fluent.models.ManagedCertificateInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Managed Certificates. */ +@Fluent +public final class ManagedCertificateCollection { + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to next page of resources. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of ManagedCertificateCollection class. */ + public ManagedCertificateCollection() { + } + + /** + * Get the value property: Collection of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of resources. + * + * @param value the value value to set. + * @return the ManagedCertificateCollection object itself. + */ + public ManagedCertificateCollection withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model ManagedCertificateCollection")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ManagedCertificateCollection.class); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.java new file mode 100644 index 0000000000000..291c8a1efe6f2 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateDomainControlValidation.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Selected type of domain control validation for managed certificates. */ +public final class ManagedCertificateDomainControlValidation + extends ExpandableStringEnum { + /** Static value CNAME for ManagedCertificateDomainControlValidation. */ + public static final ManagedCertificateDomainControlValidation CNAME = fromString("CNAME"); + + /** Static value HTTP for ManagedCertificateDomainControlValidation. */ + public static final ManagedCertificateDomainControlValidation HTTP = fromString("HTTP"); + + /** Static value TXT for ManagedCertificateDomainControlValidation. */ + public static final ManagedCertificateDomainControlValidation TXT = fromString("TXT"); + + /** + * Creates a new instance of ManagedCertificateDomainControlValidation value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedCertificateDomainControlValidation() { + } + + /** + * Creates or finds a ManagedCertificateDomainControlValidation from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedCertificateDomainControlValidation. + */ + @JsonCreator + public static ManagedCertificateDomainControlValidation fromString(String name) { + return fromString(name, ManagedCertificateDomainControlValidation.class); + } + + /** + * Gets known ManagedCertificateDomainControlValidation values. + * + * @return known ManagedCertificateDomainControlValidation values. + */ + public static Collection values() { + return values(ManagedCertificateDomainControlValidation.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.java new file mode 100644 index 0000000000000..b13c65047e596 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificatePatch.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A managed certificate to update. */ +@Fluent +public final class ManagedCertificatePatch { + /* + * Application-specific metadata in the form of key-value pairs. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of ManagedCertificatePatch class. */ + public ManagedCertificatePatch() { + } + + /** + * Get the tags property: Application-specific metadata in the form of key-value pairs. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Application-specific metadata in the form of key-value pairs. + * + * @param tags the tags value to set. + * @return the ManagedCertificatePatch object itself. + */ + public ManagedCertificatePatch withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java new file mode 100644 index 0000000000000..cafc6a8482430 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificateProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Certificate resource specific properties. */ +@Fluent +public final class ManagedCertificateProperties { + /* + * Provisioning state of the certificate. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private CertificateProvisioningState provisioningState; + + /* + * Subject name of the certificate. + */ + @JsonProperty(value = "subjectName") + private String subjectName; + + /* + * Any error occurred during the certificate provision. + */ + @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) + private String error; + + /* + * Selected type of domain control validation for managed certificates. + */ + @JsonProperty(value = "domainControlValidation") + private ManagedCertificateDomainControlValidation domainControlValidation; + + /* + * A TXT token used for DNS TXT domain control validation when issuing this type of managed certificates. + */ + @JsonProperty(value = "validationToken", access = JsonProperty.Access.WRITE_ONLY) + private String validationToken; + + /** Creates an instance of ManagedCertificateProperties class. */ + public ManagedCertificateProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of the certificate. + * + * @return the provisioningState value. + */ + public CertificateProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subjectName property: Subject name of the certificate. + * + * @return the subjectName value. + */ + public String subjectName() { + return this.subjectName; + } + + /** + * Set the subjectName property: Subject name of the certificate. + * + * @param subjectName the subjectName value to set. + * @return the ManagedCertificateProperties object itself. + */ + public ManagedCertificateProperties withSubjectName(String subjectName) { + this.subjectName = subjectName; + return this; + } + + /** + * Get the error property: Any error occurred during the certificate provision. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Get the domainControlValidation property: Selected type of domain control validation for managed certificates. + * + * @return the domainControlValidation value. + */ + public ManagedCertificateDomainControlValidation domainControlValidation() { + return this.domainControlValidation; + } + + /** + * Set the domainControlValidation property: Selected type of domain control validation for managed certificates. + * + * @param domainControlValidation the domainControlValidation value to set. + * @return the ManagedCertificateProperties object itself. + */ + public ManagedCertificateProperties withDomainControlValidation( + ManagedCertificateDomainControlValidation domainControlValidation) { + this.domainControlValidation = domainControlValidation; + return this; + } + + /** + * Get the validationToken property: A TXT token used for DNS TXT domain control validation when issuing this type + * of managed certificates. + * + * @return the validationToken value. + */ + public String validationToken() { + return this.validationToken; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.java new file mode 100644 index 0000000000000..b8dddf1b849fe --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedCertificates.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.appcontainers.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 ManagedCertificates. */ +public interface ManagedCertificates { + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context); + + /** + * Get the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate. + */ + ManagedCertificate get(String resourceGroupName, String environmentName, String managedCertificateName); + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String environmentName, String managedCertificateName, Context context); + + /** + * Deletes the specified Managed Certificate. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param managedCertificateName Name of the Managed Certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException 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 environmentName, String managedCertificateName); + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName); + + /** + * Get the Managed Certificates in a given managed environment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param environmentName Name of the Managed Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Managed Certificates in a given managed environment as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String environmentName, Context context); + + /** + * Get the specified Managed Certificate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response}. + */ + ManagedCertificate getById(String id); + + /** + * Get the specified Managed Certificate. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Managed Certificate along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified Managed Certificate. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified Managed Certificate. + * + * @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.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request + * is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedCertificate resource. + * + * @param name resource name. + * @return the first stage of the new ManagedCertificate definition. + */ + ManagedCertificate.DefinitionStages.Blank define(String name); +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java index 3fb9b640518a3..8f71116c110ce 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironment.java @@ -50,11 +50,11 @@ public interface ManagedEnvironment { Map tags(); /** - * Gets the sku property: SKU properties of the Environment. + * Gets the kind property: Kind of the Environment. * - * @return the sku value. + * @return the kind value. */ - EnvironmentSkuProperties sku(); + String kind(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -150,6 +150,29 @@ public interface ManagedEnvironment { */ List workloadProfiles(); + /** + * Gets the kedaConfiguration property: The configuration of Keda component. + * + * @return the kedaConfiguration value. + */ + KedaConfiguration kedaConfiguration(); + + /** + * Gets the daprConfiguration property: The configuration of Dapr component. + * + * @return the daprConfiguration value. + */ + DaprConfiguration daprConfiguration(); + + /** + * Gets the infrastructureResourceGroup property: Name of the platform-managed resource group created for the + * Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be + * created in the same subscription as the subnet. + * + * @return the infrastructureResourceGroup value. + */ + String infrastructureResourceGroup(); + /** * Gets the region of the resource. * @@ -224,14 +247,17 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithSku, + DefinitionStages.WithKind, DefinitionStages.WithDaprAIInstrumentationKey, DefinitionStages.WithDaprAIConnectionString, DefinitionStages.WithVnetConfiguration, DefinitionStages.WithAppLogsConfiguration, DefinitionStages.WithZoneRedundant, DefinitionStages.WithCustomDomainConfiguration, - DefinitionStages.WithWorkloadProfiles { + DefinitionStages.WithWorkloadProfiles, + DefinitionStages.WithKedaConfiguration, + DefinitionStages.WithDaprConfiguration, + DefinitionStages.WithInfrastructureResourceGroup { /** * Executes the create request. * @@ -257,15 +283,15 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the ManagedEnvironment definition allowing to specify sku. */ - interface WithSku { + /** The stage of the ManagedEnvironment definition allowing to specify kind. */ + interface WithKind { /** - * Specifies the sku property: SKU properties of the Environment.. + * Specifies the kind property: Kind of the Environment.. * - * @param sku SKU properties of the Environment. + * @param kind Kind of the Environment. * @return the next definition stage. */ - WithCreate withSku(EnvironmentSkuProperties sku); + WithCreate withKind(String kind); } /** The stage of the ManagedEnvironment definition allowing to specify daprAIInstrumentationKey. */ interface WithDaprAIInstrumentationKey { @@ -343,6 +369,40 @@ interface WithWorkloadProfiles { */ WithCreate withWorkloadProfiles(List workloadProfiles); } + /** The stage of the ManagedEnvironment definition allowing to specify kedaConfiguration. */ + interface WithKedaConfiguration { + /** + * Specifies the kedaConfiguration property: The configuration of Keda component.. + * + * @param kedaConfiguration The configuration of Keda component. + * @return the next definition stage. + */ + WithCreate withKedaConfiguration(KedaConfiguration kedaConfiguration); + } + /** The stage of the ManagedEnvironment definition allowing to specify daprConfiguration. */ + interface WithDaprConfiguration { + /** + * Specifies the daprConfiguration property: The configuration of Dapr component.. + * + * @param daprConfiguration The configuration of Dapr component. + * @return the next definition stage. + */ + WithCreate withDaprConfiguration(DaprConfiguration daprConfiguration); + } + /** The stage of the ManagedEnvironment definition allowing to specify infrastructureResourceGroup. */ + interface WithInfrastructureResourceGroup { + /** + * Specifies the infrastructureResourceGroup property: Name of the platform-managed resource group created + * for the Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource + * group will be created in the same subscription as the subnet.. + * + * @param infrastructureResourceGroup Name of the platform-managed resource group created for the Managed + * Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be + * created in the same subscription as the subnet. + * @return the next definition stage. + */ + WithCreate withInfrastructureResourceGroup(String infrastructureResourceGroup); + } } /** * Begins update for the ManagedEnvironment resource. @@ -354,13 +414,15 @@ interface WithWorkloadProfiles { /** The template for ManagedEnvironment update. */ interface Update extends UpdateStages.WithTags, - UpdateStages.WithSku, + UpdateStages.WithKind, UpdateStages.WithDaprAIInstrumentationKey, UpdateStages.WithDaprAIConnectionString, UpdateStages.WithVnetConfiguration, UpdateStages.WithAppLogsConfiguration, UpdateStages.WithCustomDomainConfiguration, - UpdateStages.WithWorkloadProfiles { + UpdateStages.WithWorkloadProfiles, + UpdateStages.WithKedaConfiguration, + UpdateStages.WithDaprConfiguration { /** * Executes the update request. * @@ -388,15 +450,15 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ManagedEnvironment update allowing to specify sku. */ - interface WithSku { + /** The stage of the ManagedEnvironment update allowing to specify kind. */ + interface WithKind { /** - * Specifies the sku property: SKU properties of the Environment.. + * Specifies the kind property: Kind of the Environment.. * - * @param sku SKU properties of the Environment. + * @param kind Kind of the Environment. * @return the next definition stage. */ - Update withSku(EnvironmentSkuProperties sku); + Update withKind(String kind); } /** The stage of the ManagedEnvironment update allowing to specify daprAIInstrumentationKey. */ interface WithDaprAIInstrumentationKey { @@ -464,6 +526,26 @@ interface WithWorkloadProfiles { */ Update withWorkloadProfiles(List workloadProfiles); } + /** The stage of the ManagedEnvironment update allowing to specify kedaConfiguration. */ + interface WithKedaConfiguration { + /** + * Specifies the kedaConfiguration property: The configuration of Keda component.. + * + * @param kedaConfiguration The configuration of Keda component. + * @return the next definition stage. + */ + Update withKedaConfiguration(KedaConfiguration kedaConfiguration); + } + /** The stage of the ManagedEnvironment update allowing to specify daprConfiguration. */ + interface WithDaprConfiguration { + /** + * Specifies the daprConfiguration property: The configuration of Dapr component.. + * + * @param daprConfiguration The configuration of Dapr component. + * @return the next definition stage. + */ + Update withDaprConfiguration(DaprConfiguration daprConfiguration); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentOutBoundType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentOutBoundType.java deleted file mode 100644 index dc5d155af7619..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentOutBoundType.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Outbound type for the cluster. */ -public final class ManagedEnvironmentOutBoundType extends ExpandableStringEnum { - /** Static value LoadBalancer for ManagedEnvironmentOutBoundType. */ - public static final ManagedEnvironmentOutBoundType LOAD_BALANCER = fromString("LoadBalancer"); - - /** Static value UserDefinedRouting for ManagedEnvironmentOutBoundType. */ - public static final ManagedEnvironmentOutBoundType USER_DEFINED_ROUTING = fromString("UserDefinedRouting"); - - /** - * Creates or finds a ManagedEnvironmentOutBoundType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ManagedEnvironmentOutBoundType. - */ - @JsonCreator - public static ManagedEnvironmentOutBoundType fromString(String name) { - return fromString(name, ManagedEnvironmentOutBoundType.class); - } - - /** - * Gets known ManagedEnvironmentOutBoundType values. - * - * @return known ManagedEnvironmentOutBoundType values. - */ - public static Collection values() { - return values(ManagedEnvironmentOutBoundType.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentOutboundSettings.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentOutboundSettings.java deleted file mode 100644 index 73594373fa6ed..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironmentOutboundSettings.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration used to control the Environment Egress outbound traffic. */ -@Fluent -public final class ManagedEnvironmentOutboundSettings { - /* - * Outbound type for the cluster - */ - @JsonProperty(value = "outBoundType") - private ManagedEnvironmentOutBoundType outBoundType; - - /* - * Virtual Appliance IP used as the Egress controller for the Environment - */ - @JsonProperty(value = "virtualNetworkApplianceIp") - private String virtualNetworkApplianceIp; - - /** Creates an instance of ManagedEnvironmentOutboundSettings class. */ - public ManagedEnvironmentOutboundSettings() { - } - - /** - * Get the outBoundType property: Outbound type for the cluster. - * - * @return the outBoundType value. - */ - public ManagedEnvironmentOutBoundType outBoundType() { - return this.outBoundType; - } - - /** - * Set the outBoundType property: Outbound type for the cluster. - * - * @param outBoundType the outBoundType value to set. - * @return the ManagedEnvironmentOutboundSettings object itself. - */ - public ManagedEnvironmentOutboundSettings withOutBoundType(ManagedEnvironmentOutBoundType outBoundType) { - this.outBoundType = outBoundType; - return this; - } - - /** - * Get the virtualNetworkApplianceIp property: Virtual Appliance IP used as the Egress controller for the - * Environment. - * - * @return the virtualNetworkApplianceIp value. - */ - public String virtualNetworkApplianceIp() { - return this.virtualNetworkApplianceIp; - } - - /** - * Set the virtualNetworkApplianceIp property: Virtual Appliance IP used as the Egress controller for the - * Environment. - * - * @param virtualNetworkApplianceIp the virtualNetworkApplianceIp value to set. - * @return the ManagedEnvironmentOutboundSettings object itself. - */ - public ManagedEnvironmentOutboundSettings withVirtualNetworkApplianceIp(String virtualNetworkApplianceIp) { - this.virtualNetworkApplianceIp = virtualNetworkApplianceIp; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java index 313f77bd226b5..982eb2b0c3f5e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedEnvironments.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; /** Resource collection API of ManagedEnvironments. */ public interface ManagedEnvironments { @@ -127,38 +126,6 @@ Response getByResourceGroupWithResponse( */ void delete(String resourceGroupName, String environmentName, Context context); - /** - * Update Managed Environment's properties. - * - *

Patches a Managed Environment using JSON Merge Patch. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void update(String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope); - - /** - * Update Managed Environment's properties. - * - *

Patches a Managed Environment using JSON Merge Patch. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param environmentName Name of the Environment. - * @param environmentEnvelope Configuration details of the Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request - * is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void update( - String resourceGroupName, String environmentName, ManagedEnvironmentInner environmentEnvelope, Context context); - /** * Get auth token for a managed environment * @@ -192,9 +159,9 @@ Response getAuthTokenWithResponse( EnvironmentAuthToken getAuthToken(String resourceGroupName, String environmentName); /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -202,15 +169,14 @@ Response getAuthTokenWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedIterable}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ PagedIterable listWorkloadProfileStates(String resourceGroupName, String environmentName); /** - * Get all workload Profile States for a Premium Managed Environment.. + * Get all workload Profile States for a Managed Environment.. * - *

Get all workload Profile States for a Premium Managed Environment. + *

Get all workload Profile States for a Managed Environment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param environmentName Name of the Managed Environment. @@ -219,8 +185,7 @@ Response getAuthTokenWithResponse( * @throws com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all workload Profile States for a Premium Managed Environment as paginated response with {@link - * PagedIterable}. + * @return all workload Profile States for a Managed Environment as paginated response with {@link PagedIterable}. */ PagedIterable listWorkloadProfileStates( String resourceGroupName, String environmentName, Context context); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java index f65a48d3ce275..0b21b71ef2e41 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentity.java @@ -13,7 +13,7 @@ /** Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public class ManagedServiceIdentity { +public final class ManagedServiceIdentity { /* * The service principal ID of the system assigned identity. This property will only be provided for a system * assigned identity. diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java index b06d0fb6ca057..26bdab801b0b7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ManagedServiceIdentityType.java @@ -23,6 +23,15 @@ public final class ManagedServiceIdentityType extends ExpandableStringEnum containers(); + /** + * Gets the initContainers property: The init containers collection under a replica. + * + * @return the initContainers value. + */ + List initContainers(); + /** * Gets the inner com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner object. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java index cc5137a779d8d..129d1e0ff42b9 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/ReplicaContainer.java @@ -40,6 +40,18 @@ public final class ReplicaContainer { @JsonProperty(value = "restartCount") private Integer restartCount; + /* + * Current running state of the container + */ + @JsonProperty(value = "runningState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerAppContainerRunningState runningState; + + /* + * The details of container current running state + */ + @JsonProperty(value = "runningStateDetails", access = JsonProperty.Access.WRITE_ONLY) + private String runningStateDetails; + /* * Log Stream endpoint */ @@ -156,6 +168,24 @@ public ReplicaContainer withRestartCount(Integer restartCount) { return this; } + /** + * Get the runningState property: Current running state of the container. + * + * @return the runningState value. + */ + public ContainerAppContainerRunningState runningState() { + return this.runningState; + } + + /** + * Get the runningStateDetails property: The details of container current running state. + * + * @return the runningStateDetails value. + */ + public String runningStateDetails() { + return this.runningStateDetails; + } + /** * Get the logStreamEndpoint property: Log Stream endpoint. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java index dc40a43691f8f..788dab697cd45 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/RevisionHealthState.java @@ -19,6 +19,15 @@ public final class RevisionHealthState extends ExpandableStringEnum { /** Static value HTTPS for Scheme. */ public static final Scheme HTTPS = fromString("HTTPS"); + /** + * Creates a new instance of Scheme value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Scheme() { + } + /** * Creates or finds a Scheme from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java index 664ee95339c68..219d53c773e9a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Secret.java @@ -22,6 +22,19 @@ public final class Secret { @JsonProperty(value = "value") private String value; + /* + * Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned + * identity. + */ + @JsonProperty(value = "identity") + private String identity; + + /* + * Azure Key Vault URL pointing to the secret referenced by the container app. + */ + @JsonProperty(value = "keyVaultUrl") + private String keyVaultUrl; + /** Creates an instance of Secret class. */ public Secret() { } @@ -66,6 +79,48 @@ public Secret withValue(String value) { return this; } + /** + * Get the identity property: Resource ID of a managed identity to authenticate with Azure Key Vault, or System to + * use a system-assigned identity. + * + * @return the identity value. + */ + public String identity() { + return this.identity; + } + + /** + * Set the identity property: Resource ID of a managed identity to authenticate with Azure Key Vault, or System to + * use a system-assigned identity. + * + * @param identity the identity value to set. + * @return the Secret object itself. + */ + public Secret withIdentity(String identity) { + this.identity = identity; + return this; + } + + /** + * Get the keyVaultUrl property: Azure Key Vault URL pointing to the secret referenced by the container app. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: Azure Key Vault URL pointing to the secret referenced by the container app. + * + * @param keyVaultUrl the keyVaultUrl value to set. + * @return the Secret object itself. + */ + public Secret withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + /** * Validates the instance. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.java new file mode 100644 index 0000000000000..9d4e2ddaa5a22 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SecretVolumeItem.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.appcontainers.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Secret to be added to volume. */ +@Fluent +public final class SecretVolumeItem { + /* + * Name of the Container App secret from which to pull the secret value. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /* + * Path to project secret to. If no path is provided, path defaults to name of secret listed in secretRef. + */ + @JsonProperty(value = "path") + private String path; + + /** Creates an instance of SecretVolumeItem class. */ + public SecretVolumeItem() { + } + + /** + * Get the secretRef property: Name of the Container App secret from which to pull the secret value. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: Name of the Container App secret from which to pull the secret value. + * + * @param secretRef the secretRef value to set. + * @return the SecretVolumeItem object itself. + */ + public SecretVolumeItem withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Get the path property: Path to project secret to. If no path is provided, path defaults to name of secret listed + * in secretRef. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Path to project secret to. If no path is provided, path defaults to name of secret listed + * in secretRef. + * + * @param path the path value to set. + * @return the SecretVolumeItem object itself. + */ + public SecretVolumeItem withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SkuName.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SkuName.java deleted file mode 100644 index 2f9018c8ebfff..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SkuName.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Name of the Sku. */ -public final class SkuName extends ExpandableStringEnum { - /** Static value Consumption for SkuName. */ - public static final SkuName CONSUMPTION = fromString("Consumption"); - - /** Static value Premium for SkuName. */ - public static final SkuName PREMIUM = fromString("Premium"); - - /** - * Creates or finds a SkuName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SkuName. - */ - @JsonCreator - public static SkuName fromString(String name) { - return fromString(name, SkuName.class); - } - - /** - * Gets known SkuName values. - * - * @return known SkuName values. - */ - public static Collection values() { - return values(SkuName.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java index e99c063b3a2a0..5c1f3d14d013f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/SourceControlOperationState.java @@ -22,6 +22,15 @@ public final class SourceControlOperationState extends ExpandableStringEnum { /** Static value EmptyDir for StorageType. */ public static final StorageType EMPTY_DIR = fromString("EmptyDir"); + /** Static value Secret for StorageType. */ + public static final StorageType SECRET = fromString("Secret"); + + /** + * Creates a new instance of StorageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StorageType() { + } + /** * Creates or finds a StorageType from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java index e4bc9d02cee2b..6be98e5fb7116 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Template.java @@ -20,6 +20,15 @@ public final class Template { @JsonProperty(value = "revisionSuffix") private String revisionSuffix; + /* + * Optional duration in seconds the Container App Instance needs to terminate gracefully. Value must be + * non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut + * down). If this value is nil, the default grace period will be used instead. Set this value longer than the + * expected cleanup time for your process. Defaults to 30 seconds. + */ + @JsonProperty(value = "terminationGracePeriodSeconds") + private Long terminationGracePeriodSeconds; + /* * List of specialized containers that run before app containers. */ @@ -68,6 +77,32 @@ public Template withRevisionSuffix(String revisionSuffix) { return this; } + /** + * Get the terminationGracePeriodSeconds property: Optional duration in seconds the Container App Instance needs to + * terminate gracefully. Value must be non-negative integer. The value zero indicates stop immediately via the kill + * signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. Set + * this value longer than the expected cleanup time for your process. Defaults to 30 seconds. + * + * @return the terminationGracePeriodSeconds value. + */ + public Long terminationGracePeriodSeconds() { + return this.terminationGracePeriodSeconds; + } + + /** + * Set the terminationGracePeriodSeconds property: Optional duration in seconds the Container App Instance needs to + * terminate gracefully. Value must be non-negative integer. The value zero indicates stop immediately via the kill + * signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. Set + * this value longer than the expected cleanup time for your process. Defaults to 30 seconds. + * + * @param terminationGracePeriodSeconds the terminationGracePeriodSeconds value to set. + * @return the Template object itself. + */ + public Template withTerminationGracePeriodSeconds(Long terminationGracePeriodSeconds) { + this.terminationGracePeriodSeconds = terminationGracePeriodSeconds; + return this; + } + /** * Get the initContainers property: List of specialized containers that run before app containers. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.java new file mode 100644 index 0000000000000..968ac93972e3a --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/TriggerType.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.appcontainers.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Trigger type of the job. */ +public final class TriggerType extends ExpandableStringEnum { + /** Static value Scheduled for TriggerType. */ + public static final TriggerType SCHEDULED = fromString("Scheduled"); + + /** Static value Event for TriggerType. */ + public static final TriggerType EVENT = fromString("Event"); + + /** Static value Manual for TriggerType. */ + public static final TriggerType MANUAL = fromString("Manual"); + + /** + * Creates a new instance of TriggerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TriggerType() { + } + + /** + * Creates or finds a TriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TriggerType. + */ + @JsonCreator + public static TriggerType fromString(String name) { + return fromString(name, TriggerType.class); + } + + /** + * Gets known TriggerType values. + * + * @return known TriggerType values. + */ + public static Collection values() { + return values(TriggerType.class); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java index f6780b693f9b4..d7c75a6a0542b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Type.java @@ -19,6 +19,15 @@ public final class Type extends ExpandableStringEnum { /** Static value Startup for Type. */ public static final Type STARTUP = fromString("Startup"); + /** + * Creates a new instance of Type value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Type() { + } + /** * Creates or finds a Type from its string representation. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java index 0078780653c5b..5d590ce71821b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/UserAssignedIdentity.java @@ -10,7 +10,7 @@ /** User assigned identity properties. */ @Immutable -public class UserAssignedIdentity { +public final class UserAssignedIdentity { /* * The principal ID of the assigned identity. */ diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java index 411c85b2c65a0..9ab43cd344391 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VnetConfiguration.java @@ -12,25 +12,17 @@ public final class VnetConfiguration { /* * Boolean indicating the environment only has an internal load balancer. These environments do not have a public - * static IP resource. They must provide runtimeSubnetId and infrastructureSubnetId if enabling this property + * static IP resource. They must provide infrastructureSubnetId if enabling this property */ @JsonProperty(value = "internal") private Boolean internal; /* - * Resource ID of a subnet for infrastructure components. This subnet must be in the same VNET as the subnet - * defined in runtimeSubnetId. Must not overlap with any other provided IP ranges. + * Resource ID of a subnet for infrastructure components. Must not overlap with any other provided IP ranges. */ @JsonProperty(value = "infrastructureSubnetId") private String infrastructureSubnetId; - /* - * Resource ID of a subnet that Container App containers are injected into. This subnet must be in the same VNET as - * the subnet defined in infrastructureSubnetId. Must not overlap with any other provided IP ranges. - */ - @JsonProperty(value = "runtimeSubnetId") - private String runtimeSubnetId; - /* * CIDR notation IP range assigned to the Docker bridge, network. Must not overlap with any other provided IP * ranges. @@ -52,20 +44,14 @@ public final class VnetConfiguration { @JsonProperty(value = "platformReservedDnsIP") private String platformReservedDnsIp; - /* - * Configuration used to control the Environment Egress outbound traffic - */ - @JsonProperty(value = "outboundSettings") - private ManagedEnvironmentOutboundSettings outboundSettings; - /** Creates an instance of VnetConfiguration class. */ public VnetConfiguration() { } /** * Get the internal property: Boolean indicating the environment only has an internal load balancer. These - * environments do not have a public static IP resource. They must provide runtimeSubnetId and - * infrastructureSubnetId if enabling this property. + * environments do not have a public static IP resource. They must provide infrastructureSubnetId if enabling this + * property. * * @return the internal value. */ @@ -75,8 +61,8 @@ public Boolean internal() { /** * Set the internal property: Boolean indicating the environment only has an internal load balancer. These - * environments do not have a public static IP resource. They must provide runtimeSubnetId and - * infrastructureSubnetId if enabling this property. + * environments do not have a public static IP resource. They must provide infrastructureSubnetId if enabling this + * property. * * @param internal the internal value to set. * @return the VnetConfiguration object itself. @@ -87,8 +73,8 @@ public VnetConfiguration withInternal(Boolean internal) { } /** - * Get the infrastructureSubnetId property: Resource ID of a subnet for infrastructure components. This subnet must - * be in the same VNET as the subnet defined in runtimeSubnetId. Must not overlap with any other provided IP ranges. + * Get the infrastructureSubnetId property: Resource ID of a subnet for infrastructure components. Must not overlap + * with any other provided IP ranges. * * @return the infrastructureSubnetId value. */ @@ -97,8 +83,8 @@ public String infrastructureSubnetId() { } /** - * Set the infrastructureSubnetId property: Resource ID of a subnet for infrastructure components. This subnet must - * be in the same VNET as the subnet defined in runtimeSubnetId. Must not overlap with any other provided IP ranges. + * Set the infrastructureSubnetId property: Resource ID of a subnet for infrastructure components. Must not overlap + * with any other provided IP ranges. * * @param infrastructureSubnetId the infrastructureSubnetId value to set. * @return the VnetConfiguration object itself. @@ -108,30 +94,6 @@ public VnetConfiguration withInfrastructureSubnetId(String infrastructureSubnetI return this; } - /** - * Get the runtimeSubnetId property: Resource ID of a subnet that Container App containers are injected into. This - * subnet must be in the same VNET as the subnet defined in infrastructureSubnetId. Must not overlap with any other - * provided IP ranges. - * - * @return the runtimeSubnetId value. - */ - public String runtimeSubnetId() { - return this.runtimeSubnetId; - } - - /** - * Set the runtimeSubnetId property: Resource ID of a subnet that Container App containers are injected into. This - * subnet must be in the same VNET as the subnet defined in infrastructureSubnetId. Must not overlap with any other - * provided IP ranges. - * - * @param runtimeSubnetId the runtimeSubnetId value to set. - * @return the VnetConfiguration object itself. - */ - public VnetConfiguration withRuntimeSubnetId(String runtimeSubnetId) { - this.runtimeSubnetId = runtimeSubnetId; - return this; - } - /** * Get the dockerBridgeCidr property: CIDR notation IP range assigned to the Docker bridge, network. Must not * overlap with any other provided IP ranges. @@ -198,34 +160,11 @@ public VnetConfiguration withPlatformReservedDnsIp(String platformReservedDnsIp) return this; } - /** - * Get the outboundSettings property: Configuration used to control the Environment Egress outbound traffic. - * - * @return the outboundSettings value. - */ - public ManagedEnvironmentOutboundSettings outboundSettings() { - return this.outboundSettings; - } - - /** - * Set the outboundSettings property: Configuration used to control the Environment Egress outbound traffic. - * - * @param outboundSettings the outboundSettings value to set. - * @return the VnetConfiguration object itself. - */ - public VnetConfiguration withOutboundSettings(ManagedEnvironmentOutboundSettings outboundSettings) { - this.outboundSettings = outboundSettings; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (outboundSettings() != null) { - outboundSettings().validate(); - } } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java index 63d746c6e0b46..c14298b76ec7f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/Volume.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Volume definitions for the Container App. */ @Fluent @@ -23,11 +24,24 @@ public final class Volume { private StorageType storageType; /* - * Name of storage resource. No need to provide for EmptyDir. + * Name of storage resource. No need to provide for EmptyDir and Secret. */ @JsonProperty(value = "storageName") private String storageName; + /* + * List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to + * volume. + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * Mount options used while mounting the AzureFile. Must be a comma-separated string. + */ + @JsonProperty(value = "mountOptions") + private String mountOptions; + /** Creates an instance of Volume class. */ public Volume() { } @@ -73,7 +87,7 @@ public Volume withStorageType(StorageType storageType) { } /** - * Get the storageName property: Name of storage resource. No need to provide for EmptyDir. + * Get the storageName property: Name of storage resource. No need to provide for EmptyDir and Secret. * * @return the storageName value. */ @@ -82,7 +96,7 @@ public String storageName() { } /** - * Set the storageName property: Name of storage resource. No need to provide for EmptyDir. + * Set the storageName property: Name of storage resource. No need to provide for EmptyDir and Secret. * * @param storageName the storageName value to set. * @return the Volume object itself. @@ -92,11 +106,56 @@ public Volume withStorageName(String storageName) { return this; } + /** + * Get the secrets property: List of secrets to be added in volume. If no secrets are provided, all secrets in + * collection will be added to volume. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: List of secrets to be added in volume. If no secrets are provided, all secrets in + * collection will be added to volume. + * + * @param secrets the secrets value to set. + * @return the Volume object itself. + */ + public Volume withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the mountOptions property: Mount options used while mounting the AzureFile. Must be a comma-separated string. + * + * @return the mountOptions value. + */ + public String mountOptions() { + return this.mountOptions; + } + + /** + * Set the mountOptions property: Mount options used while mounting the AzureFile. Must be a comma-separated string. + * + * @param mountOptions the mountOptions value to set. + * @return the Volume object itself. + */ + public Volume withMountOptions(String mountOptions) { + this.mountOptions = mountOptions; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (secrets() != null) { + secrets().forEach(e -> e.validate()); + } } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java index d0bcf41692410..ad15f4101e738 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/VolumeMount.java @@ -22,6 +22,12 @@ public final class VolumeMount { @JsonProperty(value = "mountPath") private String mountPath; + /* + * Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + */ + @JsonProperty(value = "subPath") + private String subPath; + /** Creates an instance of VolumeMount class. */ public VolumeMount() { } @@ -66,6 +72,28 @@ public VolumeMount withMountPath(String mountPath) { return this; } + /** + * Get the subPath property: Path within the volume from which the container's volume should be mounted. Defaults to + * "" (volume's root). + * + * @return the subPath value. + */ + public String subPath() { + return this.subPath; + } + + /** + * Set the subPath property: Path within the volume from which the container's volume should be mounted. Defaults to + * "" (volume's root). + * + * @param subPath the subPath value to set. + * @return the VolumeMount object itself. + */ + public VolumeMount withSubPath(String subPath) { + this.subPath = subPath; + return this; + } + /** * Validates the instance. * diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java index 7f65d679f7e87..045be9814561c 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/main/java/com/azure/resourcemanager/appcontainers/models/WorkloadProfile.java @@ -11,6 +11,12 @@ /** Workload profile to scope container app execution. */ @Fluent public final class WorkloadProfile { + /* + * Workload profile type for the workloads to run on. + */ + @JsonProperty(value = "name", required = true) + private String name; + /* * Workload profile type for the workloads to run on. */ @@ -20,19 +26,39 @@ public final class WorkloadProfile { /* * The minimum capacity. */ - @JsonProperty(value = "minimumCount", required = true) - private int minimumCount; + @JsonProperty(value = "minimumCount") + private Integer minimumCount; /* * The maximum capacity. */ - @JsonProperty(value = "maximumCount", required = true) - private int maximumCount; + @JsonProperty(value = "maximumCount") + private Integer maximumCount; /** Creates an instance of WorkloadProfile class. */ public WorkloadProfile() { } + /** + * Get the name property: Workload profile type for the workloads to run on. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Workload profile type for the workloads to run on. + * + * @param name the name value to set. + * @return the WorkloadProfile object itself. + */ + public WorkloadProfile withName(String name) { + this.name = name; + return this; + } + /** * Get the workloadProfileType property: Workload profile type for the workloads to run on. * @@ -58,7 +84,7 @@ public WorkloadProfile withWorkloadProfileType(String workloadProfileType) { * * @return the minimumCount value. */ - public int minimumCount() { + public Integer minimumCount() { return this.minimumCount; } @@ -68,7 +94,7 @@ public int minimumCount() { * @param minimumCount the minimumCount value to set. * @return the WorkloadProfile object itself. */ - public WorkloadProfile withMinimumCount(int minimumCount) { + public WorkloadProfile withMinimumCount(Integer minimumCount) { this.minimumCount = minimumCount; return this; } @@ -78,7 +104,7 @@ public WorkloadProfile withMinimumCount(int minimumCount) { * * @return the maximumCount value. */ - public int maximumCount() { + public Integer maximumCount() { return this.maximumCount; } @@ -88,7 +114,7 @@ public int maximumCount() { * @param maximumCount the maximumCount value to set. * @return the WorkloadProfile object itself. */ - public WorkloadProfile withMaximumCount(int maximumCount) { + public WorkloadProfile withMaximumCount(Integer maximumCount) { this.maximumCount = maximumCount; return this; } @@ -99,6 +125,11 @@ public WorkloadProfile withMaximumCount(int maximumCount) { * @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 WorkloadProfile")); + } if (workloadProfileType() == null) { throw LOGGER .logExceptionAsError( diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java index cb3b124a6d1d6..c435f1746a7f3 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for AvailableWorkloadProfiles Get. */ public final class AvailableWorkloadProfilesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AvailableWorkloadProfiles_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AvailableWorkloadProfiles_Get.json */ /** * Sample code: BillingMeters_Get. @@ -17,6 +15,6 @@ public final class AvailableWorkloadProfilesGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.availableWorkloadProfiles().get("East US", Context.NONE); + manager.availableWorkloadProfiles().get("East US", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java index 5a61c09fc5195..67bdd2ad5bb37 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/BillingMetersGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for BillingMeters Get. */ public final class BillingMetersGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/BillingMeters_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/BillingMeters_Get.json */ /** * Sample code: BillingMeters_Get. @@ -17,6 +15,6 @@ public final class BillingMetersGetSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void billingMetersGet(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.billingMeters().getWithResponse("East US", Context.NONE); + manager.billingMeters().getWithResponse("East US", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java index 01c68c8b82cd7..32add2044cce2 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesCreateOrUpdateSamples.java @@ -4,12 +4,13 @@ package com.azure.resourcemanager.appcontainers.generated; +import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; import com.azure.resourcemanager.appcontainers.models.CertificateProperties; /** Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -20,13 +21,16 @@ public static void createOrUpdateCertificate( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .certificates() - .define("certificate-firendly-name") - .withRegion("East US") - .withExistingManagedEnvironment("examplerg", "testcontainerenv") - .withProperties( - new CertificateProperties() - .withPassword("private key password") - .withValue("PFX-or-PEM-blob".getBytes())) - .create(); + .createOrUpdateWithResponse( + "examplerg", + "testcontainerenv", + "certificate-firendly-name", + new CertificateInner() + .withLocation("East US") + .withProperties( + new CertificateProperties() + .withPassword("fakeTokenPlaceholder") + .withValue("Y2VydA==".getBytes())), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java index ba5d9fdaca292..8565e5be596a1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for Certificates Delete. */ public final class CertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -19,6 +17,7 @@ public final class CertificatesDeleteSamples { public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .certificates() - .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .deleteWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java index 8c03998b60ca9..c8a4ae516ef7f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for Certificates Get. */ public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificate_Get.json */ /** * Sample code: Get Certificate. @@ -19,6 +17,7 @@ public final class CertificatesGetSamples { public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .certificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java index 78d2e8e1bdbb5..802098a5e21b4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for Certificates List. */ public final class CertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificates_ListByManagedEnvironment.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificates_ListByManagedEnvironment.json */ /** * Sample code: List Certificates by Managed Environment. @@ -18,6 +16,6 @@ public final class CertificatesListSamples { */ public static void listCertificatesByManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.certificates().list("examplerg", "testcontainerenv", Context.NONE); + manager.certificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java index db66bc2a7f9df..dd1b37a527a74 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/CertificatesUpdateSamples.java @@ -4,15 +4,14 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.models.Certificate; +import com.azure.resourcemanager.appcontainers.models.CertificatePatch; import java.util.HashMap; import java.util.Map; /** Samples for Certificates Update. */ public final class CertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificates_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -20,12 +19,14 @@ public final class CertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - Certificate resource = - manager - .certificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE) - .getValue(); - resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); + manager + .certificates() + .updateWithResponse( + "examplerg", + "testcontainerenv", + "certificate-firendly-name", + new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java index 0b2dd06451947..1ecce19d4ffa7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesCreateOrUpdateSamples.java @@ -4,14 +4,12 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.CertificateInner; import com.azure.resourcemanager.appcontainers.models.CertificateProperties; /** Samples for ConnectedEnvironmentsCertificates CreateOrUpdate. */ public final class ConnectedEnvironmentsCertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json */ /** * Sample code: Create or Update Certificate. @@ -22,16 +20,11 @@ public static void createOrUpdateCertificate( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsCertificates() - .createOrUpdateWithResponse( - "examplerg", - "testcontainerenv", - "certificate-firendly-name", - new CertificateInner() - .withLocation("East US") - .withProperties( - new CertificateProperties() - .withPassword("private key password") - .withValue("PFX-or-PEM-blob".getBytes())), - Context.NONE); + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingConnectedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new CertificateProperties().withPassword("fakeTokenPlaceholder").withValue("Y2VydA==".getBytes())) + .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java index 21e25b3fd21cf..9e3efd70cd473 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsCertificates Delete. */ public final class ConnectedEnvironmentsCertificatesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificate_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificate_Delete.json */ /** * Sample code: Delete Certificate. @@ -19,6 +17,7 @@ public final class ConnectedEnvironmentsCertificatesDeleteSamples { public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsCertificates() - .deleteWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .deleteWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java index 7516a6391ae80..cd95826ff3108 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsCertificates Get. */ public final class ConnectedEnvironmentsCertificatesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificate_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificate_Get.json */ /** * Sample code: Get Certificate. @@ -19,6 +17,7 @@ public final class ConnectedEnvironmentsCertificatesGetSamples { public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsCertificates() - .getWithResponse("examplerg", "testcontainerenv", "certificate-firendly-name", Context.NONE); + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java index 5b8c0e11d2f63..bc2be88c089d4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsCertificates List. */ public final class ConnectedEnvironmentsCertificatesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json */ /** * Sample code: List Certificates by Connected Environment. @@ -18,6 +16,8 @@ public final class ConnectedEnvironmentsCertificatesListSamples { */ public static void listCertificatesByConnectedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsCertificates().list("examplerg", "testcontainerenv", Context.NONE); + manager + .connectedEnvironmentsCertificates() + .list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java index c2ea3462e4953..cc7cde0e70f6f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCertificatesUpdateSamples.java @@ -4,15 +4,14 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.models.CertificatePatch; +import com.azure.resourcemanager.appcontainers.models.Certificate; import java.util.HashMap; import java.util.Map; /** Samples for ConnectedEnvironmentsCertificates Update. */ public final class ConnectedEnvironmentsCertificatesUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificates_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificates_Patch.json */ /** * Sample code: Patch Certificate. @@ -20,14 +19,13 @@ public final class ConnectedEnvironmentsCertificatesUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager - .connectedEnvironmentsCertificates() - .updateWithResponse( - "examplerg", - "testcontainerenv", - "certificate-firendly-name", - new CertificatePatch().withTags(mapOf("tag1", "value1", "tag2", "value2")), - Context.NONE); + Certificate resource = + manager + .connectedEnvironmentsCertificates() + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } @SuppressWarnings("unchecked") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java index eb7a2b950c5b9..315c0fba3e1f7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCheckNameAvailabilitySamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; /** Samples for ConnectedEnvironments CheckNameAvailability. */ public final class ConnectedEnvironmentsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -27,6 +26,6 @@ public static void certificatesCheckNameAvailability( new CheckNameAvailabilityRequest() .withName("testcertificatename") .withType("Microsoft.App/connectedEnvironments/certificates"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java index 522f5ec60a7e4..1292624dbdfce 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for ConnectedEnvironments CreateOrUpdate. */ public final class ConnectedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create kube environments. @@ -28,8 +28,8 @@ public static void createKubeEnvironments(com.azure.resourcemanager.appcontainer .withCustomDomainConfiguration( new CustomDomainConfiguration() .withDnsSuffix("www.my-name.com") - .withCertificateValue("PFX-or-PEM-blob".getBytes()) - .withCertificatePassword("private key password".getBytes())) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java index cd3fa3e3ef56b..b8e80e3944e99 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Arrays; @@ -13,7 +11,7 @@ /** Samples for ConnectedEnvironmentsDaprComponents CreateOrUpdate. */ public final class ConnectedEnvironmentsDaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json */ /** * Sample code: Create or update dapr component. @@ -24,24 +22,21 @@ public static void createOrUpdateDaprComponent( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .createOrUpdateWithResponse( - "examplerg", - "myenvironment", - "reddog", - new DaprComponentInner() - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")), - Context.NONE); + .define("reddog") + .withExistingConnectedEnvironment("examplerg", "myenvironment") + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")) + .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java index a69345b86f61d..c4a9d7d1e4a83 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents Delete. */ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -19,6 +17,6 @@ public final class ConnectedEnvironmentsDaprComponentsDeleteSamples { public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .deleteWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java index d390a2855c97e..3c2a431856235 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents Get. */ public final class ConnectedEnvironmentsDaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json */ /** * Sample code: Get Dapr Component. @@ -19,6 +17,6 @@ public final class ConnectedEnvironmentsDaprComponentsGetSamples { public static void getDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java index 128602c62d89d..a4d388a34306f 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents List. */ public final class ConnectedEnvironmentsDaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -17,6 +15,8 @@ public final class ConnectedEnvironmentsDaprComponentsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsDaprComponents().list("examplerg", "myenvironment", Context.NONE); + manager + .connectedEnvironmentsDaprComponents() + .list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java index a61beb8526707..8c866b01522e4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListSecretsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsDaprComponents ListSecrets. */ public final class ConnectedEnvironmentsDaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -20,6 +18,6 @@ public static void listContainerAppsSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .connectedEnvironmentsDaprComponents() - .listSecretsWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java index e9217065c241c..a0f547b5820b0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments Delete. */ public final class ConnectedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_Delete.json */ /** * Sample code: Delete connected environment by connectedEnvironmentName. @@ -18,6 +16,6 @@ public final class ConnectedEnvironmentsDeleteSamples { */ public static void deleteConnectedEnvironmentByConnectedEnvironmentName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + manager.connectedEnvironments().delete("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java index a7d39482efc5c..cf435bd4faec4 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments GetByResourceGroup. */ public final class ConnectedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_Get.json */ /** * Sample code: Get connected environment by connectedEnvironmentName. @@ -18,6 +16,8 @@ public final class ConnectedEnvironmentsGetByResourceGroupSamples { */ public static void getConnectedEnvironmentByConnectedEnvironmentName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().getByResourceGroupWithResponse("examplerg", "examplekenv", Context.NONE); + manager + .connectedEnvironments() + .getByResourceGroupWithResponse("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java index 82cc091edcaa1..876c6d9fe9901 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments ListByResourceGroup. */ public final class ConnectedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_ListByResourceGroup.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_ListByResourceGroup.json */ /** * Sample code: List environments by resource group. @@ -18,6 +16,6 @@ public final class ConnectedEnvironmentsListByResourceGroupSamples { */ public static void listEnvironmentsByResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().listByResourceGroup("examplerg", Context.NONE); + manager.connectedEnvironments().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java index 30f3f82abc13d..aad46e0241175 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments List. */ public final class ConnectedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_ListBySubscription.json */ /** * Sample code: List connected environments by subscription. @@ -18,6 +16,6 @@ public final class ConnectedEnvironmentsListSamples { */ public static void listConnectedEnvironmentsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().list(Context.NONE); + manager.connectedEnvironments().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java index 48dd759809e9d..b2fda66c62844 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for ConnectedEnvironmentsStorages CreateOrUpdate. */ public final class ConnectedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json */ /** * Sample code: Create or update environments storage. @@ -29,7 +29,7 @@ public static void createOrUpdateEnvironmentsStorage( .withAzureFile( new AzureFileProperties() .withAccountName("account1") - .withAccountKey("key") + .withAccountKey("fakeTokenPlaceholder") .withAccessMode(AccessMode.READ_ONLY) .withShareName("share1"))) .create(); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java index 3d32e15e66d47..2467f960be906 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsStorages Delete. */ public final class ConnectedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -18,6 +16,8 @@ public final class ConnectedEnvironmentsStoragesDeleteSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().deleteWithResponse("examplerg", "env", "jlaw-demo1", Context.NONE); + manager + .connectedEnvironmentsStorages() + .deleteWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java index 985b69a863c2b..eca3d765ca1fe 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsStorages Get. */ public final class ConnectedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage properties by subscription. @@ -18,6 +16,8 @@ public final class ConnectedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStoragePropertiesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().getWithResponse("examplerg", "env", "jlaw-demo1", Context.NONE); + manager + .connectedEnvironmentsStorages() + .getWithResponse("examplerg", "env", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java index 7bc9c5c70084c..f2b7f83d39164 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsStoragesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironmentsStorages List. */ public final class ConnectedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsStorages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -18,6 +16,8 @@ public final class ConnectedEnvironmentsStoragesListSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + manager + .connectedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java index 0ab238827263a..d3d098349df79 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsUpdateSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ConnectedEnvironments Update. */ public final class ConnectedEnvironmentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironments_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ConnectedEnvironments_Patch.json */ /** * Sample code: Patch Managed Environment. @@ -18,6 +16,6 @@ public final class ConnectedEnvironmentsUpdateSamples { */ public static void patchManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.connectedEnvironments().updateWithResponse("examplerg", "testenv", Context.NONE); + manager.connectedEnvironments().updateWithResponse("examplerg", "testenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java index 2af3fe3a1f3db..aa5616dfadf12 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsCreateOrUpdateSamples.java @@ -14,7 +14,7 @@ /** Samples for ContainerAppsAuthConfigs CreateOrUpdate. */ public final class ContainerAppsAuthConfigsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App AuthConfig. @@ -35,7 +35,9 @@ public static void createOrUpdateContainerAppAuthConfig( .withFacebook( new Facebook() .withRegistration( - new AppRegistration().withAppId("123").withAppSecretSettingName("facebook-secret")))) + new AppRegistration() + .withAppId("123") + .withAppSecretSettingName("fakeTokenPlaceholder")))) .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java index 02b1f78b72172..efd3635381767 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsAuthConfigs Delete. */ public final class ContainerAppsAuthConfigsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_Delete.json */ /** * Sample code: Delete Container App AuthConfig. @@ -20,6 +18,6 @@ public static void deleteContainerAppAuthConfig( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsAuthConfigs() - .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + .deleteWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java index eba01b17982f0..73ba415cfadfa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsAuthConfigs Get. */ public final class ContainerAppsAuthConfigsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_Get.json */ /** * Sample code: Get Container App's AuthConfig. @@ -20,6 +18,6 @@ public static void getContainerAppSAuthConfig( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsAuthConfigs() - .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java index 5151311e9b5e6..17ceb2d7d55fe 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsAuthConfigs ListByContainerApp. */ public final class ContainerAppsAuthConfigsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/AuthConfigs_ListByContainer.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/AuthConfigs_ListByContainer.json */ /** * Sample code: List Auth Configs by Container Apps. @@ -18,6 +16,8 @@ public final class ContainerAppsAuthConfigsListByContainerAppSamples { */ public static void listAuthConfigsByContainerApps( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsAuthConfigs().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + manager + .containerAppsAuthConfigs() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java index e60fa035af7a0..20480c9b33660 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateSamples.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.appcontainers.generated; import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.Affinity; import com.azure.resourcemanager.appcontainers.models.AppProtocol; import com.azure.resourcemanager.appcontainers.models.BindingType; import com.azure.resourcemanager.appcontainers.models.Configuration; @@ -14,10 +15,13 @@ import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.CorsPolicy; import com.azure.resourcemanager.appcontainers.models.CustomDomain; import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; import com.azure.resourcemanager.appcontainers.models.Ingress; +import com.azure.resourcemanager.appcontainers.models.IngressClientCertificateMode; +import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; @@ -35,7 +39,7 @@ /** Samples for ContainerApps CreateOrUpdate. */ public final class ContainerAppsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App. @@ -51,7 +55,7 @@ public static void createOrUpdateContainerApp( .withExistingResourceGroup("rg") .withEnvironmentId( "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") - .withWorkloadProfileType("GeneralPurpose") + .withWorkloadProfileName("My-GP-01") .withConfiguration( new Configuration() .withIngress( @@ -92,7 +96,17 @@ public static void createOrUpdateContainerApp( .withDescription( "Allowing all IP's within the subnet below to access containerapp") .withIpAddressRange("192.168.1.1/8") - .withAction(Action.ALLOW)))) + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY)) + .withClientCertificateMode(IngressClientCertificateMode.ACCEPT) + .withCorsPolicy( + new CorsPolicy() + .withAllowedOrigins(Arrays.asList("https://a.test.com", "https://b.test.com")) + .withAllowedMethods(Arrays.asList("GET", "POST")) + .withAllowedHeaders(Arrays.asList("HEADER1", "HEADER2")) + .withExposeHeaders(Arrays.asList("HEADER3", "HEADER4")) + .withMaxAge(1234) + .withAllowCredentials(true))) .withDapr( new Dapr() .withEnabled(true) @@ -154,7 +168,7 @@ public static void createOrUpdateContainerApp( } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json */ /** * Sample code: Create or Update Tcp App. @@ -214,6 +228,70 @@ public static void createOrUpdateTcpApp(com.azure.resourcemanager.appcontainers. .create(); } + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update ManagedBy App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateManagedByApp( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .containerApps() + .define("testcontainerAppManagedBy") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedBy( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .withExposedPort(4000) + .withTransport(IngressTransportMethod.TCP) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerAppManagedBy-ab1234") + .withWeight(100))))) + .withTemplate( + new Template() + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerAppManagedBy:v1") + .withName("testcontainerAppManagedBy") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withTcpSocket(new ContainerAppProbeTcpSocket().withPort(8080)) + .withType(Type.LIVENESS))))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("tcpscalingrule") + .withTcp( + new TcpScaleRule() + .withMetadata(mapOf("concurrentConnections", "50"))))))) + .create(); + } + @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java index 8add349fae66f..94815ad18cbeb 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps Delete. */ public final class ContainerAppsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Delete.json */ /** * Sample code: Delete Container App. @@ -17,6 +15,6 @@ public final class ContainerAppsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().delete("rg", "testWorkerApp0", Context.NONE); + manager.containerApps().delete("rg", "testWorkerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java index 33994d2b505ae..9cf6bfa428885 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetDetectorSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics GetDetector. */ public final class ContainerAppsDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerAppsDiagnostics_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerAppsDiagnostics_Get.json */ /** * Sample code: Get Container App's diagnostics info. @@ -21,6 +19,9 @@ public static void getContainerAppSDiagnosticsInfo( manager .containerAppsDiagnostics() .getDetectorWithResponse( - "mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", Context.NONE); + "mikono-workerapp-test-rg", + "mikono-capp-stage1", + "cappcontainerappnetworkIO", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java index e5c4a81564578..3f18101e792be 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRevisionSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics GetRevision. */ public final class ContainerAppsDiagnosticsGetRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -20,6 +18,7 @@ public static void getContainerAppSRevision( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsDiagnostics() - .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .getRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java index e0c052a830ae8..8ad5d7c93335d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsGetRootSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics GetRoot. */ public final class ContainerAppsDiagnosticsGetRootSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -17,6 +15,8 @@ public final class ContainerAppsDiagnosticsGetRootSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().getRootWithResponse("rg", "testcontainerApp0", Context.NONE); + manager + .containerAppsDiagnostics() + .getRootWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java index 94801afae7276..c1b5d5547cc18 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics ListDetectors. */ public final class ContainerAppsDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerAppsDiagnostics_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerAppsDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostics for a given Container App. @@ -20,6 +18,6 @@ public static void getTheListOfAvailableDiagnosticsForAGivenContainerApp( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsDiagnostics() - .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", Context.NONE); + .listDetectors("mikono-workerapp-test-rg", "mikono-capp-stage1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java index fecef91f927ae..2eeafe21515aa 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsDiagnostics ListRevisions. */ public final class ContainerAppsDiagnosticsListRevisionsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -18,6 +16,8 @@ public final class ContainerAppsDiagnosticsListRevisionsSamples { */ public static void listContainerAppSRevisions( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsDiagnostics().listRevisions("rg", "testcontainerApp0", null, Context.NONE); + manager + .containerAppsDiagnostics() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java index d12d281193dcd..ecf4f8c855a71 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetAuthTokenSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps GetAuthToken. */ public final class ContainerAppsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_GetAuthToken.json */ /** * Sample code: Get Container App Auth Token. @@ -18,6 +16,6 @@ public final class ContainerAppsGetAuthTokenSamples { */ public static void getContainerAppAuthToken( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerApp0", Context.NONE); + manager.containerApps().getAuthTokenWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java index cd34f1b253fac..42dcc36193849 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps GetByResourceGroup. */ public final class ContainerAppsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Get.json */ /** * Sample code: Get Container App. @@ -17,6 +15,8 @@ public final class ContainerAppsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE); + manager + .containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java index 5d328c5b2fb4c..24663f443b8a6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps ListByResourceGroup. */ public final class ContainerAppsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListByResourceGroup.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListByResourceGroup.json */ /** * Sample code: List Container Apps by resource group. @@ -18,6 +16,6 @@ public final class ContainerAppsListByResourceGroupSamples { */ public static void listContainerAppsByResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listByResourceGroup("rg", Context.NONE); + manager.containerApps().listByResourceGroup("rg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java index 9a017f67da977..6365b5c657f21 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListCustomHostnameAnalysisSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps ListCustomHostnameAnalysis. */ public final class ContainerAppsListCustomHostnameAnalysisSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json */ /** * Sample code: Analyze Custom Hostname. @@ -19,6 +17,7 @@ public final class ContainerAppsListCustomHostnameAnalysisSamples { public static void analyzeCustomHostname(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerApps() - .listCustomHostnameAnalysisWithResponse("rg", "testcontainerApp0", "my.name.corp", Context.NONE); + .listCustomHostnameAnalysisWithResponse( + "rg", "testcontainerApp0", "my.name.corp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java index d885680399817..4b8a7a508afef 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps List. */ public final class ContainerAppsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListBySubscription.json */ /** * Sample code: List Container Apps by subscription. @@ -18,6 +16,6 @@ public final class ContainerAppsListSamples { */ public static void listContainerAppsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().list(Context.NONE); + manager.containerApps().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java index 9a17fe1e8d4a9..b8e9578813a8a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListSecretsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerApps ListSecrets. */ public final class ContainerAppsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -18,6 +16,6 @@ public final class ContainerAppsListSecretsSamples { */ public static void listContainerAppsSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", Context.NONE); + manager.containerApps().listSecretsWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java index f61fd0c8c7aec..aaa684e821065 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisionReplicas GetReplica. */ public final class ContainerAppsRevisionReplicasGetReplicaSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Replicas_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Replicas_Get.json */ /** * Sample code: Get Container App's revision replica. @@ -21,6 +19,10 @@ public static void getContainerAppSRevisionReplica( manager .containerAppsRevisionReplicas() .getReplicaWithResponse( - "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", Context.NONE); + "workerapps-rg-xj", + "myapp", + "myapp--0wlqy09", + "myapp--0wlqy09-5d9774cff-5wnd8", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java index d8dd9e3f9dd67..5c8cf44c662a5 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionReplicasListReplicasSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisionReplicas ListReplicas. */ public final class ContainerAppsRevisionReplicasListReplicasSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Replicas_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Replicas_List.json */ /** * Sample code: List Container App's replicas. @@ -20,6 +18,6 @@ public static void listContainerAppSReplicas( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisionReplicas() - .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", Context.NONE); + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java index c874ecf8f9dbc..b184dafbbd040 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsActivateRevisionSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions ActivateRevision. */ public final class ContainerAppsRevisionsActivateRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Activate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Activate.json */ /** * Sample code: Activate Container App's revision. @@ -20,6 +18,7 @@ public static void activateContainerAppSRevision( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .activateRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java index a50104cc55453..5b9db284f2f09 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions DeactivateRevision. */ public final class ContainerAppsRevisionsDeactivateRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Deactivate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Deactivate.json */ /** * Sample code: Deactivate Container App's revision. @@ -20,6 +18,7 @@ public static void deactivateContainerAppSRevision( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .deactivateRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java index 40770dc22e01f..5c45031db0126 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsGetRevisionSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions GetRevision. */ public final class ContainerAppsRevisionsGetRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Get.json */ /** * Sample code: Get Container App's revision. @@ -20,6 +18,7 @@ public static void getContainerAppSRevision( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + .getRevisionWithResponse( + "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java index 8b6e6137e0a5b..b226025b0fe67 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions ListRevisions. */ public final class ContainerAppsRevisionsListRevisionsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_List.json */ /** * Sample code: List Container App's revisions. @@ -18,6 +16,8 @@ public final class ContainerAppsRevisionsListRevisionsSamples { */ public static void listContainerAppSRevisions( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", null, Context.NONE); + manager + .containerAppsRevisions() + .listRevisions("rg", "testcontainerApp0", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java index 75ec2cca6581a..264ff10cd3d00 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsRestartRevisionSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsRevisions RestartRevision. */ public final class ContainerAppsRevisionsRestartRevisionSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Revisions_Restart.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Revisions_Restart.json */ /** * Sample code: Restart Container App's revision. @@ -20,6 +18,7 @@ public static void restartContainerAppSRevision( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsRevisions() - .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", Context.NONE); + .restartRevisionWithResponse( + "rg", "testStaticSite0", "testcontainerApp0-pjxhsye", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java index b22cf60e93781..42fbf235bee1e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for ContainerAppsSourceControls CreateOrUpdate. */ public final class ContainerAppsSourceControlsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_CreateOrUpdate.json */ /** * Sample code: Create or Update Container App SourceControl. @@ -32,11 +32,11 @@ public static void createOrUpdateContainerAppSourceControl( new RegistryInfo() .withRegistryUrl("xwang971reg.azurecr.io") .withRegistryUsername("xwang971reg") - .withRegistryPassword("")) + .withRegistryPassword("fakeTokenPlaceholder")) .withAzureCredentials( new AzureCredentials() .withClientId("") - .withClientSecret("") + .withClientSecret("fakeTokenPlaceholder") .withTenantId("")) .withContextPath("./") .withImage("image/tag")) diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java index 243a89a2b5382..be001ea1e11ac 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsSourceControls Delete. */ public final class ContainerAppsSourceControlsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_Delete.json */ /** * Sample code: Delete Container App SourceControl. @@ -18,6 +16,8 @@ public final class ContainerAppsSourceControlsDeleteSamples { */ public static void deleteContainerAppSourceControl( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + manager + .containerAppsSourceControls() + .delete("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java index c8e88ef5d8b36..84a73234c6139 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsSourceControls Get. */ public final class ContainerAppsSourceControlsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_Get.json */ /** * Sample code: Get Container App's SourceControl. @@ -20,6 +18,6 @@ public static void getContainerAppSSourceControl( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .containerAppsSourceControls() - .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java index ed84c27a47b48..6d37cb149d6ab 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ContainerAppsSourceControls ListByContainerApp. */ public final class ContainerAppsSourceControlsListByContainerAppSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/SourceControls_ListByContainer.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/SourceControls_ListByContainer.json */ /** * Sample code: List App's Source Controls. @@ -17,6 +15,8 @@ public final class ContainerAppsSourceControlsListByContainerAppSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listAppSSourceControls(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + manager + .containerAppsSourceControls() + .listByContainerApp("workerapps-rg-xj", "testcanadacentral", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java index 7c693a2a1f803..d24f5199e1cad 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsUpdateSamples.java @@ -4,13 +4,13 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; import com.azure.resourcemanager.appcontainers.models.Action; +import com.azure.resourcemanager.appcontainers.models.Affinity; import com.azure.resourcemanager.appcontainers.models.AppProtocol; import com.azure.resourcemanager.appcontainers.models.BindingType; import com.azure.resourcemanager.appcontainers.models.Configuration; import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerApp; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; @@ -19,6 +19,7 @@ import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; import com.azure.resourcemanager.appcontainers.models.Dapr; import com.azure.resourcemanager.appcontainers.models.Ingress; +import com.azure.resourcemanager.appcontainers.models.IngressStickySessions; import com.azure.resourcemanager.appcontainers.models.InitContainer; import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; import com.azure.resourcemanager.appcontainers.models.LogLevel; @@ -34,7 +35,7 @@ /** Samples for ContainerApps Update. */ public final class ContainerAppsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Patch.json */ /** * Sample code: Patch Container App. @@ -42,113 +43,112 @@ public final class ContainerAppsUpdateSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void patchContainerApp(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager - .containerApps() - .update( - "rg", - "testcontainerApp0", - new ContainerAppInner() - .withLocation("East US") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) - .withConfiguration( - new Configuration() - .withIngress( - new Ingress() - .withExternal(true) - .withTargetPort(3000) - .withTraffic( - Arrays - .asList( - new TrafficWeight() - .withRevisionName("testcontainerApp0-ab1234") - .withWeight(100) - .withLabel("production"))) - .withCustomDomains( - Arrays - .asList( - new CustomDomain() - .withName("www.my-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - new CustomDomain() - .withName("www.my-other-name.com") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId( - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) - .withIpSecurityRestrictions( - Arrays - .asList( - new IpSecurityRestrictionRule() - .withName("Allow work IP A subnet") - .withDescription( - "Allowing all IP's within the subnet below to access" - + " containerapp") - .withIpAddressRange("192.168.1.1/32") - .withAction(Action.ALLOW), - new IpSecurityRestrictionRule() - .withName("Allow work IP B subnet") - .withDescription( - "Allowing all IP's within the subnet below to access" - + " containerapp") - .withIpAddressRange("192.168.1.1/8") - .withAction(Action.ALLOW)))) - .withDapr( - new Dapr() - .withEnabled(true) - .withAppProtocol(AppProtocol.HTTP) - .withAppPort(3000) - .withHttpReadBufferSize(30) - .withHttpMaxRequestSize(10) - .withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(10)) - .withTemplate( - new Template() - .withInitContainers( + ContainerApp resource = + manager + .containerApps() + .getByResourceGroupWithResponse("rg", "testcontainerApp0", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .withConfiguration( + new Configuration() + .withIngress( + new Ingress() + .withExternal(true) + .withTargetPort(3000) + .withTraffic( + Arrays + .asList( + new TrafficWeight() + .withRevisionName("testcontainerApp0-ab1234") + .withWeight(100) + .withLabel("production"))) + .withCustomDomains( Arrays .asList( - new InitContainer() - .withImage("repo/testcontainerApp0:v4") - .withName("testinitcontainerApp0") - .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) - .withContainers( + new CustomDomain() + .withName("www.my-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), + new CustomDomain() + .withName("www.my-other-name.com") + .withBindingType(BindingType.SNI_ENABLED) + .withCertificateId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"))) + .withIpSecurityRestrictions( Arrays .asList( - new Container() - .withImage("repo/testcontainerApp0:v1") - .withName("testcontainerApp0") - .withProbes( - Arrays - .asList( - new ContainerAppProbe() - .withHttpGet( - new ContainerAppProbeHttpGet() - .withHttpHeaders( - Arrays - .asList( - new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("Custom-Header") - .withValue("Awesome"))) - .withPath("/health") - .withPort(8080)) - .withInitialDelaySeconds(3) - .withPeriodSeconds(3) - .withType(Type.LIVENESS))))) - .withScale( - new Scale() - .withMinReplicas(1) - .withMaxReplicas(5) - .withRules( + new IpSecurityRestrictionRule() + .withName("Allow work IP A subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/32") + .withAction(Action.ALLOW), + new IpSecurityRestrictionRule() + .withName("Allow work IP B subnet") + .withDescription( + "Allowing all IP's within the subnet below to access containerapp") + .withIpAddressRange("192.168.1.1/8") + .withAction(Action.ALLOW))) + .withStickySessions(new IngressStickySessions().withAffinity(Affinity.STICKY))) + .withDapr( + new Dapr() + .withEnabled(true) + .withAppProtocol(AppProtocol.HTTP) + .withAppPort(3000) + .withHttpReadBufferSize(30) + .withHttpMaxRequestSize(10) + .withLogLevel(LogLevel.DEBUG) + .withEnableApiLogging(true)) + .withMaxInactiveRevisions(10)) + .withTemplate( + new Template() + .withInitContainers( + Arrays + .asList( + new InitContainer() + .withImage("repo/testcontainerApp0:v4") + .withName("testinitcontainerApp0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerApp0:v1") + .withName("testcontainerApp0") + .withProbes( Arrays .asList( - new ScaleRule() - .withName("httpscalingrule") - .withCustom( - new CustomScaleRule() - .withType("http") - .withMetadata(mapOf("concurrentRequests", "50"))))))), - Context.NONE); + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("httpscalingrule") + .withCustom( + new CustomScaleRule() + .withType("http") + .withMetadata(mapOf("concurrentRequests", "50"))))))) + .apply(); } @SuppressWarnings("unchecked") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java index ca9c24c4c77bf..d3da093a120c1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCreateOrUpdateSamples.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.appcontainers.generated; +import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; import com.azure.resourcemanager.appcontainers.models.DaprMetadata; import com.azure.resourcemanager.appcontainers.models.Secret; import java.util.Arrays; @@ -11,7 +12,7 @@ /** Samples for DaprComponents CreateOrUpdate. */ public final class DaprComponentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json */ /** * Sample code: Create or update dapr component with secrets. @@ -22,26 +23,29 @@ public static void createOrUpdateDaprComponentWithSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .daprComponents() - .define("reddog") - .withExistingManagedEnvironment("examplerg", "myenvironment") - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .create(); + .createOrUpdateWithResponse( + "examplerg", + "myenvironment", + "reddog", + new DaprComponentInner() + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecrets(Arrays.asList(new Secret().withName("masterkey").withValue("keyvalue"))) + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json */ /** * Sample code: Create or update dapr component with secret store component. @@ -52,21 +56,24 @@ public static void createOrUpdateDaprComponentWithSecretStoreComponent( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .daprComponents() - .define("reddog") - .withExistingManagedEnvironment("examplerg", "myenvironment") - .withComponentType("state.azure.cosmosdb") - .withVersion("v1") - .withIgnoreErrors(false) - .withInitTimeout("50s") - .withSecretStoreComponent("my-secret-store") - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("url").withValue(""), - new DaprMetadata().withName("database").withValue("itemsDB"), - new DaprMetadata().withName("collection").withValue("items"), - new DaprMetadata().withName("masterkey").withSecretRef("masterkey"))) - .withScopes(Arrays.asList("container-app-1", "container-app-2")) - .create(); + .createOrUpdateWithResponse( + "examplerg", + "myenvironment", + "reddog", + new DaprComponentInner() + .withComponentType("state.azure.cosmosdb") + .withVersion("v1") + .withIgnoreErrors(false) + .withInitTimeout("50s") + .withSecretStoreComponent("fakeTokenPlaceholder") + .withMetadata( + Arrays + .asList( + new DaprMetadata().withName("url").withValue(""), + new DaprMetadata().withName("database").withValue("itemsDB"), + new DaprMetadata().withName("collection").withValue("items"), + new DaprMetadata().withName("masterkey").withSecretRef("fakeTokenPlaceholder"))) + .withScopes(Arrays.asList("container-app-1", "container-app-2")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java index b7da35a6649a4..bd4893db2acb7 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for DaprComponents Delete. */ public final class DaprComponentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_Delete.json */ /** * Sample code: Delete dapr component. @@ -17,6 +15,8 @@ public final class DaprComponentsDeleteSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void deleteDaprComponent(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().deleteWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .deleteWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java index 43f1c579ea9d0..be79c353bb64b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for DaprComponents Get. */ public final class DaprComponentsGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_Get_SecretStoreComponent.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_Get_SecretStoreComponent.json */ /** * Sample code: Get Dapr Component with secret store component. @@ -18,11 +16,13 @@ public final class DaprComponentsGetSamples { */ public static void getDaprComponentWithSecretStoreComponent( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_Get_Secrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_Get_Secrets.json */ /** * Sample code: Get Dapr Component with secrets. @@ -31,6 +31,8 @@ public static void getDaprComponentWithSecretStoreComponent( */ public static void getDaprComponentWithSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().getWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .getWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java index 722a171a9c772..2cf0047a545b1 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for DaprComponents List. */ public final class DaprComponentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_List.json */ /** * Sample code: List Dapr Components. @@ -17,6 +15,6 @@ public final class DaprComponentsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listDaprComponents(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().list("examplerg", "myenvironment", Context.NONE); + manager.daprComponents().list("examplerg", "myenvironment", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java index f301616014cac..e6a4f47784dc6 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListSecretsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for DaprComponents ListSecrets. */ public final class DaprComponentsListSecretsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/DaprComponents_ListSecrets.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/DaprComponents_ListSecrets.json */ /** * Sample code: List Container Apps Secrets. @@ -18,6 +16,8 @@ public final class DaprComponentsListSecretsSamples { */ public static void listContainerAppsSecrets( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.daprComponents().listSecretsWithResponse("examplerg", "myenvironment", "reddog", Context.NONE); + manager + .daprComponents() + .listSecretsWithResponse("examplerg", "myenvironment", "reddog", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..2daedbc4b2fdc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsCreateOrUpdateSamples.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.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.TriggerType; +import com.azure.resourcemanager.appcontainers.models.Type; +import java.util.Arrays; + +/** Samples for Jobs CreateOrUpdate. */ +public final class JobsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_CreateorUpdate.json + */ + /** + * Sample code: Create or Update Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppsJob( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .jobs() + .define("testcontainerAppsJob0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration( + new JobConfiguration() + .withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig().withReplicaCompletionCount(1).withParallelism(4))) + .withTemplate( + new JobTemplate() + .withInitContainers( + Arrays + .asList( + new InitContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(5) + .withPeriodSeconds(3) + .withType(Type.LIVENESS)))))) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java new file mode 100644 index 0000000000000..fd2cae8808427 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsDeleteSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for Jobs Delete. */ +public final class JobsDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Delete.json + */ + /** + * Sample code: Delete Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().delete("rg", "testWorkerContainerAppsJob0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java new file mode 100644 index 0000000000000..4c4a19c2d34ec --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsExecutionsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for JobsExecutions List. */ +public final class JobsExecutionsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Executions_Get.json + */ + /** + * Sample code: Get a Container Apps Job Executions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAContainerAppsJobExecutions( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobsExecutions().list("rg", "testcontainerAppsJob0", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..76c438f1a8830 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsGetByResourceGroupSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for Jobs GetByResourceGroup. */ +public final class JobsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Get.json + */ + /** + * Sample code: Get Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..463cff617ffaf --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for Jobs ListByResourceGroup. */ +public final class JobsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Jobs_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps Jobs by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsJobsByResourceGroup( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java new file mode 100644 index 0000000000000..ee47506e096bc --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for Jobs List. */ +public final class JobsListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Jobs_ListBySubscription.json + */ + /** + * Sample code: List Container Apps Jobs by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsJobsBySubscription( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java new file mode 100644 index 0000000000000..fd57aad810872 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsListSecretsSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for Jobs ListSecrets. */ +public final class JobsListSecretsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_ListSecrets.json + */ + /** + * Sample code: List Container Apps Job Secrets. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsJobSecrets( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().listSecretsWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.java new file mode 100644 index 0000000000000..5b263f7e638b3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStartSamples.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.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.JobExecutionContainer; +import com.azure.resourcemanager.appcontainers.models.JobExecutionTemplate; +import java.util.Arrays; + +/** Samples for Jobs Start. */ +public final class JobsStartSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Start.json + */ + /** + * Sample code: Run a Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void runAContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .jobs() + .start( + "rg", + "testcontainerAppsJob0", + new JobExecutionTemplate() + .withContainers( + Arrays + .asList( + new JobExecutionContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testcontainerAppsJob0") + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withInitContainers( + Arrays + .asList( + new JobExecutionContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java new file mode 100644 index 0000000000000..0a53297d4d568 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopExecutionSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for Jobs StopExecution. */ +public final class JobsStopExecutionSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Stop_Execution.json + */ + /** + * Sample code: Terminate a Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void terminateAContainerAppsJob( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.jobs().stopExecution("rg", "testcontainerAppsJob0", "jobExecution1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.java new file mode 100644 index 0000000000000..464725f7eb1e9 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsStopMultipleExecutionsSamples.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.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.fluent.models.JobExecutionBaseInner; +import com.azure.resourcemanager.appcontainers.models.JobExecutionNamesCollection; +import java.util.Arrays; + +/** Samples for Jobs StopMultipleExecutions. */ +public final class JobsStopMultipleExecutionsSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Stop_Multiple.json + */ + /** + * Sample code: Terminate Multiple Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void terminateMultipleContainerAppsJob( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .jobs() + .stopMultipleExecutions( + "rg", + "testcontainerAppsJob0", + new JobExecutionNamesCollection() + .withValue( + Arrays + .asList( + new JobExecutionBaseInner().withName("jobExecution-27944453"), + new JobExecutionBaseInner().withName("jobExecution-27944452"), + new JobExecutionBaseInner().withName("jobExecution-27944451"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java new file mode 100644 index 0000000000000..1c9f49e080946 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/JobsUpdateSamples.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.Container; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; +import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; +import com.azure.resourcemanager.appcontainers.models.ContainerResources; +import com.azure.resourcemanager.appcontainers.models.InitContainer; +import com.azure.resourcemanager.appcontainers.models.Job; +import com.azure.resourcemanager.appcontainers.models.JobConfiguration; +import com.azure.resourcemanager.appcontainers.models.JobConfigurationManualTriggerConfig; +import com.azure.resourcemanager.appcontainers.models.JobPatchPropertiesProperties; +import com.azure.resourcemanager.appcontainers.models.JobTemplate; +import com.azure.resourcemanager.appcontainers.models.TriggerType; +import com.azure.resourcemanager.appcontainers.models.Type; +import java.util.Arrays; + +/** Samples for Jobs Update. */ +public final class JobsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Job_Patch.json + */ + /** + * Sample code: Patch Container Apps Job. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerAppsJob(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + Job resource = + manager + .jobs() + .getByResourceGroupWithResponse("rg", "testcontainerAppsJob0", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new JobPatchPropertiesProperties() + .withConfiguration( + new JobConfiguration() + .withTriggerType(TriggerType.MANUAL) + .withReplicaTimeout(10) + .withReplicaRetryLimit(10) + .withManualTriggerConfig( + new JobConfigurationManualTriggerConfig() + .withReplicaCompletionCount(1) + .withParallelism(4))) + .withTemplate( + new JobTemplate() + .withInitContainers( + Arrays + .asList( + new InitContainer() + .withImage("repo/testcontainerAppsJob0:v4") + .withName("testinitcontainerAppsJob0") + .withCommand(Arrays.asList("/bin/sh")) + .withArgs(Arrays.asList("-c", "while true; do echo hello; sleep 10;done")) + .withResources(new ContainerResources().withCpu(0.2D).withMemory("100Mi")))) + .withContainers( + Arrays + .asList( + new Container() + .withImage("repo/testcontainerAppsJob0:v1") + .withName("testcontainerAppsJob0") + .withProbes( + Arrays + .asList( + new ContainerAppProbe() + .withHttpGet( + new ContainerAppProbeHttpGet() + .withHttpHeaders( + Arrays + .asList( + new ContainerAppProbeHttpGetHttpHeadersItem() + .withName("Custom-Header") + .withValue("Awesome"))) + .withPath("/health") + .withPort(8080)) + .withInitialDelaySeconds(3) + .withPeriodSeconds(3) + .withType(Type.LIVENESS))))))) + .apply(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d29233eec8364 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesCreateOrUpdateSamples.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.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateDomainControlValidation; +import com.azure.resourcemanager.appcontainers.models.ManagedCertificateProperties; + +/** Samples for ManagedCertificates CreateOrUpdate. */ +public final class ManagedCertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificate_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateCertificate( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedCertificates() + .define("certificate-firendly-name") + .withRegion("East US") + .withExistingManagedEnvironment("examplerg", "testcontainerenv") + .withProperties( + new ManagedCertificateProperties() + .withSubjectName("my-subject-name.company.country.net") + .withDomainControlValidation(ManagedCertificateDomainControlValidation.CNAME)) + .create(); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.java new file mode 100644 index 0000000000000..bc33d2abbe98d --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesDeleteSamples.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.appcontainers.generated; + +/** Samples for ManagedCertificates Delete. */ +public final class ManagedCertificatesDeleteSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificate_Delete.json + */ + /** + * Sample code: Delete Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedCertificates() + .deleteWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.java new file mode 100644 index 0000000000000..36258394827f3 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesGetSamples.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.appcontainers.generated; + +/** Samples for ManagedCertificates Get. */ +public final class ManagedCertificatesGetSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificate_Get.json + */ + /** + * Sample code: Get Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getCertificate(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedCertificates() + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java new file mode 100644 index 0000000000000..860d9e5b4a359 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.appcontainers.generated; + +/** Samples for ManagedCertificates List. */ +public final class ManagedCertificatesListSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificates_ListByManagedEnvironment.json + */ + /** + * Sample code: List Managed Certificates by Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listManagedCertificatesByManagedEnvironment( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager.managedCertificates().list("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.java new file mode 100644 index 0000000000000..8dd8a869a6224 --- /dev/null +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedCertificatesUpdateSamples.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.appcontainers.generated; + +import com.azure.resourcemanager.appcontainers.models.ManagedCertificate; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ManagedCertificates Update. */ +public final class ManagedCertificatesUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedCertificates_Patch.json + */ + /** + * Sample code: Patch Managed Certificate. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchManagedCertificate( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + ManagedCertificate resource = + manager + .managedCertificates() + .getWithResponse( + "examplerg", "testcontainerenv", "certificate-firendly-name", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).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/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java index 8f468b00f2e56..dbd3fa2083349 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsGetDetectorSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentDiagnostics GetDetector. */ public final class ManagedEnvironmentDiagnosticsGetDetectorSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentDiagnostics_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentDiagnostics_Get.json */ /** * Sample code: Get diagnostic data for a managed environments. @@ -21,6 +19,9 @@ public static void getDiagnosticDataForAManagedEnvironments( manager .managedEnvironmentDiagnostics() .getDetectorWithResponse( - "mikono-workerapp-test-rg", "mikonokubeenv", "ManagedEnvAvailabilityMetrics", Context.NONE); + "mikono-workerapp-test-rg", + "mikonokubeenv", + "ManagedEnvAvailabilityMetrics", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java index a85c61336f73d..22c8b5b6e6b14 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentDiagnosticsListDetectorsSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentDiagnostics ListDetectors. */ public final class ManagedEnvironmentDiagnosticsListDetectorsSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentDiagnostics_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentDiagnostics_List.json */ /** * Sample code: Get the list of available diagnostic data for a managed environments. @@ -20,6 +18,6 @@ public static void getTheListOfAvailableDiagnosticDataForAManagedEnvironments( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { manager .managedEnvironmentDiagnostics() - .listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", Context.NONE); + .listDetectorsWithResponse("mikono-workerapp-test-rg", "mikonokubeenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java index 750e5d106db96..6122e9992b04e 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsCreateOrUpdateSamples.java @@ -6,11 +6,7 @@ import com.azure.resourcemanager.appcontainers.models.AppLogsConfiguration; import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import com.azure.resourcemanager.appcontainers.models.EnvironmentSkuProperties; import com.azure.resourcemanager.appcontainers.models.LogAnalyticsConfiguration; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutBoundType; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutboundSettings; -import com.azure.resourcemanager.appcontainers.models.SkuName; import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; import java.util.Arrays; @@ -18,7 +14,61 @@ /** Samples for ManagedEnvironments CreateOrUpdate. */ public final class ManagedEnvironmentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json + */ + /** + * Sample code: Create environment with custom infrastructureResourceGroup. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createEnvironmentWithCustomInfrastructureResourceGroup( + com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { + manager + .managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withDaprAIConnectionString( + "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") + .withVnetConfiguration( + new VnetConfiguration() + .withInfrastructureSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) + .withAppLogsConfiguration( + new AppLogsConfiguration() + .withLogAnalyticsConfiguration( + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) + .withZoneRedundant(true) + .withCustomDomainConfiguration( + new CustomDomainConfiguration() + .withDnsSuffix("www.my-name.com") + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) + .withWorkloadProfiles( + Arrays + .asList( + new WorkloadProfile() + .withName("My-GP-01") + .withWorkloadProfileType("GeneralPurpose") + .withMinimumCount(3) + .withMaximumCount(12), + new WorkloadProfile() + .withName("My-MO-01") + .withWorkloadProfileType("MemoryOptimized") + .withMinimumCount(3) + .withMaximumCount(6), + new WorkloadProfile() + .withName("My-CO-01") + .withWorkloadProfileType("ComputeOptimized") + .withMinimumCount(3) + .withMaximumCount(6), + new WorkloadProfile().withName("My-consumption-01").withWorkloadProfileType("Consumption"))) + .withInfrastructureResourceGroup("myInfrastructureRgName") + .create(); + } + + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json */ /** * Sample code: Create environments. @@ -31,40 +81,41 @@ public static void createEnvironments(com.azure.resourcemanager.appcontainers.Co .define("testcontainerenv") .withRegion("East US") .withExistingResourceGroup("examplerg") - .withSku(new EnvironmentSkuProperties().withName(SkuName.PREMIUM)) .withDaprAIConnectionString( "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/") .withVnetConfiguration( new VnetConfiguration() - .withOutboundSettings( - new ManagedEnvironmentOutboundSettings() - .withOutBoundType(ManagedEnvironmentOutBoundType.USER_DEFINED_ROUTING) - .withVirtualNetworkApplianceIp("192.168.1.20"))) + .withInfrastructureSubnetId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1")) .withAppLogsConfiguration( new AppLogsConfiguration() .withLogAnalyticsConfiguration( - new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("string"))) + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("fakeTokenPlaceholder"))) .withZoneRedundant(true) .withCustomDomainConfiguration( new CustomDomainConfiguration() .withDnsSuffix("www.my-name.com") - .withCertificateValue("PFX-or-PEM-blob".getBytes()) - .withCertificatePassword("private key password".getBytes())) + .withCertificateValue("Y2VydA==".getBytes()) + .withCertificatePassword("fakeTokenPlaceholder")) .withWorkloadProfiles( Arrays .asList( new WorkloadProfile() + .withName("My-GP-01") .withWorkloadProfileType("GeneralPurpose") .withMinimumCount(3) .withMaximumCount(12), new WorkloadProfile() + .withName("My-MO-01") .withWorkloadProfileType("MemoryOptimized") .withMinimumCount(3) .withMaximumCount(6), new WorkloadProfile() + .withName("My-CO-01") .withWorkloadProfileType("ComputeOptimized") .withMinimumCount(3) - .withMaximumCount(6))) + .withMaximumCount(6), + new WorkloadProfile().withName("My-consumption-01").withWorkloadProfileType("Consumption"))) .create(); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java index 4166699a9962c..397541625d286 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments Delete. */ public final class ManagedEnvironmentsDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Delete.json */ /** * Sample code: Delete environment by name. @@ -18,6 +16,6 @@ public final class ManagedEnvironmentsDeleteSamples { */ public static void deleteEnvironmentByName( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + manager.managedEnvironments().delete("examplerg", "examplekenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java index efb4da6fedf3f..c653708ed3c13 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDiagnosticsGetRootSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsDiagnostics GetRoot. */ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -17,6 +15,8 @@ public final class ManagedEnvironmentsDiagnosticsGetRootSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getEnvironmentsByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsDiagnostics().getRootWithResponse("examplerg", "jlaw-demo1", Context.NONE); + manager + .managedEnvironmentsDiagnostics() + .getRootWithResponse("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java index bdf62a7cc8a25..e831f1dcca31a 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetAuthTokenSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments GetAuthToken. */ public final class ManagedEnvironmentsGetAuthTokenSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_GetAuthToken.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_GetAuthToken.json */ /** * Sample code: Get Managed Environment Auth Token. @@ -18,6 +16,6 @@ public final class ManagedEnvironmentsGetAuthTokenSamples { */ public static void getManagedEnvironmentAuthToken( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().getAuthTokenWithResponse("rg", "testenv", Context.NONE); + manager.managedEnvironments().getAuthTokenWithResponse("rg", "testenv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java index de387050cbce0..cca074cffd9bc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments GetByResourceGroup. */ public final class ManagedEnvironmentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Get.json */ /** * Sample code: Get environments by name. @@ -17,6 +15,8 @@ public final class ManagedEnvironmentsGetByResourceGroupSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void getEnvironmentsByName(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", Context.NONE); + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java index 56733c8475f41..e1109e6cc6cb0 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListByResourceGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments ListByResourceGroup. */ public final class ManagedEnvironmentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json */ /** * Sample code: List environments by resource group. @@ -18,6 +16,6 @@ public final class ManagedEnvironmentsListByResourceGroupSamples { */ public static void listEnvironmentsByResourceGroup( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().listByResourceGroup("examplerg", Context.NONE); + manager.managedEnvironments().listByResourceGroup("examplerg", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java index fb5a7e7e2aaf9..65c3105bf7830 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments List. */ public final class ManagedEnvironmentsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_ListBySubscription.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_ListBySubscription.json */ /** * Sample code: List environments by subscription. @@ -18,6 +16,6 @@ public final class ManagedEnvironmentsListSamples { */ public static void listEnvironmentsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().list(Context.NONE); + manager.managedEnvironments().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java index 5ae4808ba630f..10d3772b555cc 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironments ListWorkloadProfileStates. */ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json */ /** * Sample code: List environments by subscription. @@ -18,6 +16,8 @@ public final class ManagedEnvironmentsListWorkloadProfileStatesSamples { */ public static void listEnvironmentsBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironments().listWorkloadProfileStates("examplerg", "jlaw-demo1", Context.NONE); + manager + .managedEnvironments() + .listWorkloadProfileStates("examplerg", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java index 3bef9aeafacd4..cad9801d11443 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json */ /** * Sample code: Create or update environments storage. @@ -29,7 +29,7 @@ public static void createOrUpdateEnvironmentsStorage( .withAzureFile( new AzureFileProperties() .withAccountName("account1") - .withAccountKey("key") + .withAccountKey("fakeTokenPlaceholder") .withAccessMode(AccessMode.READ_ONLY) .withShareName("share1"))) .create(); diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java index 0425718576728..657dee3beea22 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsStorages Delete. */ public final class ManagedEnvironmentsStoragesDeleteSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_Delete.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_Delete.json */ /** * Sample code: List environments storages by subscription. @@ -18,6 +16,8 @@ public final class ManagedEnvironmentsStoragesDeleteSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + manager + .managedEnvironmentsStorages() + .deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java index 923f94843e836..51934958f8b03 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsStorages Get. */ public final class ManagedEnvironmentsStoragesGetSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_Get.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_Get.json */ /** * Sample code: get a environments storage properties by subscription. @@ -18,6 +16,8 @@ public final class ManagedEnvironmentsStoragesGetSamples { */ public static void getAEnvironmentsStoragePropertiesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + manager + .managedEnvironmentsStorages() + .getWithResponse("examplerg", "managedEnv", "jlaw-demo1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java index 10f08f791fee9..bda3fbc378975 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsStoragesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for ManagedEnvironmentsStorages List. */ public final class ManagedEnvironmentsStoragesListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironmentsStorages_List.json */ /** * Sample code: List environments storages by subscription. @@ -18,6 +16,8 @@ public final class ManagedEnvironmentsStoragesListSamples { */ public static void listEnvironmentsStoragesBySubscription( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + manager + .managedEnvironmentsStorages() + .listWithResponse("examplerg", "managedEnv", com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java index 99932fc462a6c..5baaaf4267a7d 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsUpdateSamples.java @@ -4,15 +4,14 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.appcontainers.models.ManagedEnvironment; import java.util.HashMap; import java.util.Map; /** Samples for ManagedEnvironments Update. */ public final class ManagedEnvironmentsUpdateSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_Patch.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ManagedEnvironments_Patch.json */ /** * Sample code: Patch Managed Environment. @@ -21,15 +20,12 @@ public final class ManagedEnvironmentsUpdateSamples { */ public static void patchManagedEnvironment( com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager - .managedEnvironments() - .update( - "examplerg", - "testcontainerenv", - new ManagedEnvironmentInner() - .withLocation("East US") - .withTags(mapOf("tag1", "value1", "tag2", "value2")), - Context.NONE); + ManagedEnvironment resource = + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "testcontainerenv", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1", "tag2", "value2")).apply(); } @SuppressWarnings("unchecked") diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java index 9fe9d81cd3863..231c64abc7f48 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/NamespacesCheckNameAvailabilitySamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; /** Samples for Namespaces CheckNameAvailability. */ public final class NamespacesCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificates_CheckNameAvailability.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Certificates_CheckNameAvailability.json */ /** * Sample code: Certificates_CheckNameAvailability. @@ -27,11 +26,11 @@ public static void certificatesCheckNameAvailability( new CheckNameAvailabilityRequest() .withName("testcertificatename") .withType("Microsoft.App/managedEnvironments/certificates"), - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ContainerApps_CheckNameAvailability.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_CheckNameAvailability.json */ /** * Sample code: ContainerApps_CheckNameAvailability. @@ -46,6 +45,6 @@ public static void containerAppsCheckNameAvailability( "examplerg", "testcontainerenv", new CheckNameAvailabilityRequest().withName("testcappname").withType("Microsoft.App/containerApps"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java index 41eb1cd667b74..2ade91a79679b 100644 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java +++ b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/samples/java/com/azure/resourcemanager/appcontainers/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.appcontainers.generated; -import com.azure.core.util.Context; - /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Operations_List.json + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/Operations_List.json */ /** * Sample code: List all operations. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to ContainerAppsApiManager. */ public static void listAllOperations(com.azure.resourcemanager.appcontainers.ContainerAppsApiManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedAudiencesValidationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedAudiencesValidationTests.java deleted file mode 100644 index 00234c42c406f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedAudiencesValidationTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedAudiencesValidation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AllowedAudiencesValidationTests { - @Test - public void testDeserialize() { - AllowedAudiencesValidation model = - BinaryData.fromString("{\"allowedAudiences\":[\"m\"]}").toObject(AllowedAudiencesValidation.class); - Assertions.assertEquals("m", model.allowedAudiences().get(0)); - } - - @Test - public void testSerialize() { - AllowedAudiencesValidation model = new AllowedAudiencesValidation().withAllowedAudiences(Arrays.asList("m")); - model = BinaryData.fromObject(model).toObject(AllowedAudiencesValidation.class); - Assertions.assertEquals("m", model.allowedAudiences().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedPrincipalsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedPrincipalsTests.java deleted file mode 100644 index b9de692babcf2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AllowedPrincipalsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedPrincipals; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AllowedPrincipalsTests { - @Test - public void testDeserialize() { - AllowedPrincipals model = - BinaryData - .fromString("{\"groups\":[\"urzafb\",\"jjgpb\",\"oq\"],\"identities\":[\"klj\",\"vbqid\"]}") - .toObject(AllowedPrincipals.class); - Assertions.assertEquals("urzafb", model.groups().get(0)); - Assertions.assertEquals("klj", model.identities().get(0)); - } - - @Test - public void testSerialize() { - AllowedPrincipals model = - new AllowedPrincipals() - .withGroups(Arrays.asList("urzafb", "jjgpb", "oq")) - .withIdentities(Arrays.asList("klj", "vbqid")); - model = BinaryData.fromObject(model).toObject(AllowedPrincipals.class); - Assertions.assertEquals("urzafb", model.groups().get(0)); - Assertions.assertEquals("klj", model.identities().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppRegistrationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppRegistrationTests.java deleted file mode 100644 index c1f989a0beeec..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppRegistrationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AppRegistration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AppRegistrationTests { - @Test - public void testDeserialize() { - AppRegistration model = - BinaryData - .fromString("{\"appId\":\"l\",\"appSecretSettingName\":\"majtjaod\"}") - .toObject(AppRegistration.class); - Assertions.assertEquals("l", model.appId()); - Assertions.assertEquals("majtjaod", model.appSecretSettingName()); - } - - @Test - public void testSerialize() { - AppRegistration model = new AppRegistration().withAppId("l").withAppSecretSettingName("majtjaod"); - model = BinaryData.fromObject(model).toObject(AppRegistration.class); - Assertions.assertEquals("l", model.appId()); - Assertions.assertEquals("majtjaod", model.appSecretSettingName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppleRegistrationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppleRegistrationTests.java deleted file mode 100644 index 02090f7ea3d5c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppleRegistrationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AppleRegistration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AppleRegistrationTests { - @Test - public void testDeserialize() { - AppleRegistration model = - BinaryData - .fromString("{\"clientId\":\"oqfbowskanyk\",\"clientSecretSettingName\":\"lcuiywgqywgndr\"}") - .toObject(AppleRegistration.class); - Assertions.assertEquals("oqfbowskanyk", model.clientId()); - Assertions.assertEquals("lcuiywgqywgndr", model.clientSecretSettingName()); - } - - @Test - public void testSerialize() { - AppleRegistration model = - new AppleRegistration().withClientId("oqfbowskanyk").withClientSecretSettingName("lcuiywgqywgndr"); - model = BinaryData.fromObject(model).toObject(AppleRegistration.class); - Assertions.assertEquals("oqfbowskanyk", model.clientId()); - Assertions.assertEquals("lcuiywgqywgndr", model.clientSecretSettingName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppleTests.java deleted file mode 100644 index dcba9e0131e5f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AppleTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Apple; -import com.azure.resourcemanager.appcontainers.models.AppleRegistration; -import com.azure.resourcemanager.appcontainers.models.LoginScopes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AppleTests { - @Test - public void testDeserialize() { - Apple model = - BinaryData - .fromString( - "{\"enabled\":true,\"registration\":{\"clientId\":\"gnxkrxdqmidtth\",\"clientSecretSettingName\":\"vqdra\"},\"login\":{\"scopes\":[\"big\"]}}") - .toObject(Apple.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("gnxkrxdqmidtth", model.registration().clientId()); - Assertions.assertEquals("vqdra", model.registration().clientSecretSettingName()); - Assertions.assertEquals("big", model.login().scopes().get(0)); - } - - @Test - public void testSerialize() { - Apple model = - new Apple() - .withEnabled(true) - .withRegistration( - new AppleRegistration().withClientId("gnxkrxdqmidtth").withClientSecretSettingName("vqdra")) - .withLogin(new LoginScopes().withScopes(Arrays.asList("big"))); - model = BinaryData.fromObject(model).toObject(Apple.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("gnxkrxdqmidtth", model.registration().clientId()); - Assertions.assertEquals("vqdra", model.registration().clientSecretSettingName()); - Assertions.assertEquals("big", model.login().scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigCollectionTests.java deleted file mode 100644 index 82fd1a024a198..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigCollectionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AuthConfigInner; -import com.azure.resourcemanager.appcontainers.models.AuthConfigCollection; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class AuthConfigCollectionTests { - @Test - public void testDeserialize() { - AuthConfigCollection model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"xpyb\",\"name\":\"zm\",\"type\":\"hmtzopbsphrup\"},{\"properties\":{},\"id\":\"jhphoyc\",\"name\":\"sx\",\"type\":\"obhdxbmtqioqjze\"},{\"properties\":{},\"id\":\"wnoi\",\"name\":\"hwlrx\",\"type\":\"bqsoqijg\"}],\"nextLink\":\"mbpazlobcufpdzn\"}") - .toObject(AuthConfigCollection.class); - } - - @Test - public void testSerialize() { - AuthConfigCollection model = - new AuthConfigCollection() - .withValue(Arrays.asList(new AuthConfigInner(), new AuthConfigInner(), new AuthConfigInner())); - model = BinaryData.fromObject(model).toObject(AuthConfigCollection.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigInnerTests.java deleted file mode 100644 index 3f179d491cd60..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigInnerTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AuthConfigInner; -import com.azure.resourcemanager.appcontainers.models.AuthPlatform; -import com.azure.resourcemanager.appcontainers.models.GlobalValidation; -import com.azure.resourcemanager.appcontainers.models.HttpSettings; -import com.azure.resourcemanager.appcontainers.models.IdentityProviders; -import com.azure.resourcemanager.appcontainers.models.Login; -import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AuthConfigInnerTests { - @Test - public void testDeserialize() { - AuthConfigInner model = - BinaryData - .fromString( - "{\"properties\":{\"platform\":{\"enabled\":false,\"runtimeVersion\":\"jnqglhqgnu\"},\"globalValidation\":{\"unauthenticatedClientAction\":\"Return401\",\"redirectToProvider\":\"ywifsqesaag\",\"excludedPaths\":[\"glzlhjxrifkwmrv\",\"tsizntocipaoua\"]},\"identityProviders\":{\"customOpenIdConnectProviders\":{}},\"login\":{\"preserveUrlFragmentsForLogins\":true,\"allowedExternalRedirectUrls\":[\"nygj\",\"fjddeqs\",\"deupewnwrei\"]},\"httpSettings\":{\"requireHttps\":false}},\"id\":\"rh\",\"name\":\"ofcqhsm\",\"type\":\"urkdtmlx\"}") - .toObject(AuthConfigInner.class); - Assertions.assertEquals(false, model.platform().enabled()); - Assertions.assertEquals("jnqglhqgnu", model.platform().runtimeVersion()); - Assertions - .assertEquals( - UnauthenticatedClientActionV2.RETURN401, model.globalValidation().unauthenticatedClientAction()); - Assertions.assertEquals("ywifsqesaag", model.globalValidation().redirectToProvider()); - Assertions.assertEquals("glzlhjxrifkwmrv", model.globalValidation().excludedPaths().get(0)); - Assertions.assertEquals(true, model.login().preserveUrlFragmentsForLogins()); - Assertions.assertEquals("nygj", model.login().allowedExternalRedirectUrls().get(0)); - Assertions.assertEquals(false, model.httpSettings().requireHttps()); - } - - @Test - public void testSerialize() { - AuthConfigInner model = - new AuthConfigInner() - .withPlatform(new AuthPlatform().withEnabled(false).withRuntimeVersion("jnqglhqgnu")) - .withGlobalValidation( - new GlobalValidation() - .withUnauthenticatedClientAction(UnauthenticatedClientActionV2.RETURN401) - .withRedirectToProvider("ywifsqesaag") - .withExcludedPaths(Arrays.asList("glzlhjxrifkwmrv", "tsizntocipaoua"))) - .withIdentityProviders(new IdentityProviders().withCustomOpenIdConnectProviders(mapOf())) - .withLogin( - new Login() - .withPreserveUrlFragmentsForLogins(true) - .withAllowedExternalRedirectUrls(Arrays.asList("nygj", "fjddeqs", "deupewnwrei"))) - .withHttpSettings(new HttpSettings().withRequireHttps(false)); - model = BinaryData.fromObject(model).toObject(AuthConfigInner.class); - Assertions.assertEquals(false, model.platform().enabled()); - Assertions.assertEquals("jnqglhqgnu", model.platform().runtimeVersion()); - Assertions - .assertEquals( - UnauthenticatedClientActionV2.RETURN401, model.globalValidation().unauthenticatedClientAction()); - Assertions.assertEquals("ywifsqesaag", model.globalValidation().redirectToProvider()); - Assertions.assertEquals("glzlhjxrifkwmrv", model.globalValidation().excludedPaths().get(0)); - Assertions.assertEquals(true, model.login().preserveUrlFragmentsForLogins()); - Assertions.assertEquals("nygj", model.login().allowedExternalRedirectUrls().get(0)); - Assertions.assertEquals(false, model.httpSettings().requireHttps()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigPropertiesTests.java deleted file mode 100644 index 9417352161d21..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthConfigPropertiesTests.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AuthConfigProperties; -import com.azure.resourcemanager.appcontainers.models.Apple; -import com.azure.resourcemanager.appcontainers.models.AuthPlatform; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectory; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebApps; -import com.azure.resourcemanager.appcontainers.models.CookieExpiration; -import com.azure.resourcemanager.appcontainers.models.CookieExpirationConvention; -import com.azure.resourcemanager.appcontainers.models.CustomOpenIdConnectProvider; -import com.azure.resourcemanager.appcontainers.models.Facebook; -import com.azure.resourcemanager.appcontainers.models.ForwardProxy; -import com.azure.resourcemanager.appcontainers.models.ForwardProxyConvention; -import com.azure.resourcemanager.appcontainers.models.GitHub; -import com.azure.resourcemanager.appcontainers.models.GlobalValidation; -import com.azure.resourcemanager.appcontainers.models.Google; -import com.azure.resourcemanager.appcontainers.models.HttpSettings; -import com.azure.resourcemanager.appcontainers.models.HttpSettingsRoutes; -import com.azure.resourcemanager.appcontainers.models.IdentityProviders; -import com.azure.resourcemanager.appcontainers.models.Login; -import com.azure.resourcemanager.appcontainers.models.LoginRoutes; -import com.azure.resourcemanager.appcontainers.models.Nonce; -import com.azure.resourcemanager.appcontainers.models.Twitter; -import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AuthConfigPropertiesTests { - @Test - public void testDeserialize() { - AuthConfigProperties model = - BinaryData - .fromString( - "{\"platform\":{\"enabled\":true,\"runtimeVersion\":\"sjtxukcdmp\"},\"globalValidation\":{\"unauthenticatedClientAction\":\"Return403\",\"redirectToProvider\":\"uanzwuxzdx\",\"excludedPaths\":[\"rlhm\",\"hfpmrqobmtukknr\",\"rtihfxtijbpz\",\"gnwzsymglzufc\"]},\"identityProviders\":{\"azureActiveDirectory\":{\"enabled\":false,\"isAutoProvisioned\":true},\"facebook\":{\"enabled\":false,\"graphApiVersion\":\"cbjy\"},\"gitHub\":{\"enabled\":false},\"google\":{\"enabled\":true},\"twitter\":{\"enabled\":true},\"apple\":{\"enabled\":false},\"azureStaticWebApps\":{\"enabled\":false},\"customOpenIdConnectProviders\":{\"y\":{\"enabled\":false}}},\"login\":{\"routes\":{\"logoutEndpoint\":\"b\"},\"preserveUrlFragmentsForLogins\":false,\"allowedExternalRedirectUrls\":[\"vd\"],\"cookieExpiration\":{\"convention\":\"FixedTime\",\"timeToExpiration\":\"tfwvukxgaudc\"},\"nonce\":{\"validateNonce\":false,\"nonceExpirationInterval\":\"jcny\"}},\"httpSettings\":{\"requireHttps\":true,\"routes\":{\"apiPrefix\":\"htnapczwlokjyem\"},\"forwardProxy\":{\"convention\":\"NoProxy\",\"customHostHeaderName\":\"pjoxzjnch\",\"customProtoHeaderName\":\"jspodmailzyde\"}}}") - .toObject(AuthConfigProperties.class); - Assertions.assertEquals(true, model.platform().enabled()); - Assertions.assertEquals("sjtxukcdmp", model.platform().runtimeVersion()); - Assertions - .assertEquals( - UnauthenticatedClientActionV2.RETURN403, model.globalValidation().unauthenticatedClientAction()); - Assertions.assertEquals("uanzwuxzdx", model.globalValidation().redirectToProvider()); - Assertions.assertEquals("rlhm", model.globalValidation().excludedPaths().get(0)); - Assertions.assertEquals(false, model.identityProviders().azureActiveDirectory().enabled()); - Assertions.assertEquals(true, model.identityProviders().azureActiveDirectory().isAutoProvisioned()); - Assertions.assertEquals(false, model.identityProviders().facebook().enabled()); - Assertions.assertEquals("cbjy", model.identityProviders().facebook().graphApiVersion()); - Assertions.assertEquals(false, model.identityProviders().gitHub().enabled()); - Assertions.assertEquals(true, model.identityProviders().google().enabled()); - Assertions.assertEquals(true, model.identityProviders().twitter().enabled()); - Assertions.assertEquals(false, model.identityProviders().apple().enabled()); - Assertions.assertEquals(false, model.identityProviders().azureStaticWebApps().enabled()); - Assertions.assertEquals(false, model.identityProviders().customOpenIdConnectProviders().get("y").enabled()); - Assertions.assertEquals("b", model.login().routes().logoutEndpoint()); - Assertions.assertEquals(false, model.login().preserveUrlFragmentsForLogins()); - Assertions.assertEquals("vd", model.login().allowedExternalRedirectUrls().get(0)); - Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.login().cookieExpiration().convention()); - Assertions.assertEquals("tfwvukxgaudc", model.login().cookieExpiration().timeToExpiration()); - Assertions.assertEquals(false, model.login().nonce().validateNonce()); - Assertions.assertEquals("jcny", model.login().nonce().nonceExpirationInterval()); - Assertions.assertEquals(true, model.httpSettings().requireHttps()); - Assertions.assertEquals("htnapczwlokjyem", model.httpSettings().routes().apiPrefix()); - Assertions.assertEquals(ForwardProxyConvention.NO_PROXY, model.httpSettings().forwardProxy().convention()); - Assertions.assertEquals("pjoxzjnch", model.httpSettings().forwardProxy().customHostHeaderName()); - Assertions.assertEquals("jspodmailzyde", model.httpSettings().forwardProxy().customProtoHeaderName()); - } - - @Test - public void testSerialize() { - AuthConfigProperties model = - new AuthConfigProperties() - .withPlatform(new AuthPlatform().withEnabled(true).withRuntimeVersion("sjtxukcdmp")) - .withGlobalValidation( - new GlobalValidation() - .withUnauthenticatedClientAction(UnauthenticatedClientActionV2.RETURN403) - .withRedirectToProvider("uanzwuxzdx") - .withExcludedPaths(Arrays.asList("rlhm", "hfpmrqobmtukknr", "rtihfxtijbpz", "gnwzsymglzufc"))) - .withIdentityProviders( - new IdentityProviders() - .withAzureActiveDirectory( - new AzureActiveDirectory().withEnabled(false).withIsAutoProvisioned(true)) - .withFacebook(new Facebook().withEnabled(false).withGraphApiVersion("cbjy")) - .withGitHub(new GitHub().withEnabled(false)) - .withGoogle(new Google().withEnabled(true)) - .withTwitter(new Twitter().withEnabled(true)) - .withApple(new Apple().withEnabled(false)) - .withAzureStaticWebApps(new AzureStaticWebApps().withEnabled(false)) - .withCustomOpenIdConnectProviders( - mapOf("y", new CustomOpenIdConnectProvider().withEnabled(false)))) - .withLogin( - new Login() - .withRoutes(new LoginRoutes().withLogoutEndpoint("b")) - .withPreserveUrlFragmentsForLogins(false) - .withAllowedExternalRedirectUrls(Arrays.asList("vd")) - .withCookieExpiration( - new CookieExpiration() - .withConvention(CookieExpirationConvention.FIXED_TIME) - .withTimeToExpiration("tfwvukxgaudc")) - .withNonce(new Nonce().withValidateNonce(false).withNonceExpirationInterval("jcny"))) - .withHttpSettings( - new HttpSettings() - .withRequireHttps(true) - .withRoutes(new HttpSettingsRoutes().withApiPrefix("htnapczwlokjyem")) - .withForwardProxy( - new ForwardProxy() - .withConvention(ForwardProxyConvention.NO_PROXY) - .withCustomHostHeaderName("pjoxzjnch") - .withCustomProtoHeaderName("jspodmailzyde"))); - model = BinaryData.fromObject(model).toObject(AuthConfigProperties.class); - Assertions.assertEquals(true, model.platform().enabled()); - Assertions.assertEquals("sjtxukcdmp", model.platform().runtimeVersion()); - Assertions - .assertEquals( - UnauthenticatedClientActionV2.RETURN403, model.globalValidation().unauthenticatedClientAction()); - Assertions.assertEquals("uanzwuxzdx", model.globalValidation().redirectToProvider()); - Assertions.assertEquals("rlhm", model.globalValidation().excludedPaths().get(0)); - Assertions.assertEquals(false, model.identityProviders().azureActiveDirectory().enabled()); - Assertions.assertEquals(true, model.identityProviders().azureActiveDirectory().isAutoProvisioned()); - Assertions.assertEquals(false, model.identityProviders().facebook().enabled()); - Assertions.assertEquals("cbjy", model.identityProviders().facebook().graphApiVersion()); - Assertions.assertEquals(false, model.identityProviders().gitHub().enabled()); - Assertions.assertEquals(true, model.identityProviders().google().enabled()); - Assertions.assertEquals(true, model.identityProviders().twitter().enabled()); - Assertions.assertEquals(false, model.identityProviders().apple().enabled()); - Assertions.assertEquals(false, model.identityProviders().azureStaticWebApps().enabled()); - Assertions.assertEquals(false, model.identityProviders().customOpenIdConnectProviders().get("y").enabled()); - Assertions.assertEquals("b", model.login().routes().logoutEndpoint()); - Assertions.assertEquals(false, model.login().preserveUrlFragmentsForLogins()); - Assertions.assertEquals("vd", model.login().allowedExternalRedirectUrls().get(0)); - Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.login().cookieExpiration().convention()); - Assertions.assertEquals("tfwvukxgaudc", model.login().cookieExpiration().timeToExpiration()); - Assertions.assertEquals(false, model.login().nonce().validateNonce()); - Assertions.assertEquals("jcny", model.login().nonce().nonceExpirationInterval()); - Assertions.assertEquals(true, model.httpSettings().requireHttps()); - Assertions.assertEquals("htnapczwlokjyem", model.httpSettings().routes().apiPrefix()); - Assertions.assertEquals(ForwardProxyConvention.NO_PROXY, model.httpSettings().forwardProxy().convention()); - Assertions.assertEquals("pjoxzjnch", model.httpSettings().forwardProxy().customHostHeaderName()); - Assertions.assertEquals("jspodmailzyde", model.httpSettings().forwardProxy().customProtoHeaderName()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthPlatformTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthPlatformTests.java deleted file mode 100644 index 9ce13d083e266..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AuthPlatformTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AuthPlatform; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AuthPlatformTests { - @Test - public void testDeserialize() { - AuthPlatform model = - BinaryData.fromString("{\"enabled\":true,\"runtimeVersion\":\"yahux\"}").toObject(AuthPlatform.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("yahux", model.runtimeVersion()); - } - - @Test - public void testSerialize() { - AuthPlatform model = new AuthPlatform().withEnabled(true).withRuntimeVersion("yahux"); - model = BinaryData.fromObject(model).toObject(AuthPlatform.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("yahux", model.runtimeVersion()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableOperationsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableOperationsTests.java deleted file mode 100644 index 41758c7528532..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableOperationsTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.appcontainers.models.AvailableOperations; -import com.azure.resourcemanager.appcontainers.models.OperationDisplay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AvailableOperationsTests { - @Test - public void testDeserialize() { - AvailableOperations model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"kambtrnegvmnvuqe\",\"isDataAction\":false,\"display\":{\"provider\":\"pa\",\"resource\":\"jbkkdmflvestmjl\",\"operation\":\"ril\",\"description\":\"apeewchpxlkt\"},\"origin\":\"uziycsl\"},{\"name\":\"ufuztcktyhjtq\",\"isDataAction\":true,\"display\":{\"provider\":\"ulwm\",\"resource\":\"qzz\",\"operation\":\"jvpglydzgk\",\"description\":\"qeevt\"},\"origin\":\"pryu\"},{\"name\":\"wytpzdmovz\",\"isDataAction\":false,\"display\":{\"provider\":\"wzqa\",\"resource\":\"lgzurig\",\"operation\":\"ecxn\",\"description\":\"icokpv\"},\"origin\":\"lqtmldgxob\"},{\"name\":\"rclnpkc\",\"isDataAction\":false,\"display\":{\"provider\":\"iykhy\",\"resource\":\"fvjlboxqvkjlmx\",\"operation\":\"mdy\",\"description\":\"dwdigumb\"},\"origin\":\"aauzzptjazysd\"}],\"nextLink\":\"ezwwv\"}") - .toObject(AvailableOperations.class); - Assertions.assertEquals("kambtrnegvmnvuqe", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("pa", model.value().get(0).display().provider()); - Assertions.assertEquals("jbkkdmflvestmjl", model.value().get(0).display().resource()); - Assertions.assertEquals("ril", model.value().get(0).display().operation()); - Assertions.assertEquals("apeewchpxlkt", model.value().get(0).display().description()); - Assertions.assertEquals("uziycsl", model.value().get(0).origin()); - Assertions.assertEquals("ezwwv", model.nextLink()); - } - - @Test - public void testSerialize() { - AvailableOperations model = - new AvailableOperations() - .withValue( - Arrays - .asList( - new OperationDetailInner() - .withName("kambtrnegvmnvuqe") - .withIsDataAction(false) - .withDisplay( - new OperationDisplay() - .withProvider("pa") - .withResource("jbkkdmflvestmjl") - .withOperation("ril") - .withDescription("apeewchpxlkt")) - .withOrigin("uziycsl"), - new OperationDetailInner() - .withName("ufuztcktyhjtq") - .withIsDataAction(true) - .withDisplay( - new OperationDisplay() - .withProvider("ulwm") - .withResource("qzz") - .withOperation("jvpglydzgk") - .withDescription("qeevt")) - .withOrigin("pryu"), - new OperationDetailInner() - .withName("wytpzdmovz") - .withIsDataAction(false) - .withDisplay( - new OperationDisplay() - .withProvider("wzqa") - .withResource("lgzurig") - .withOperation("ecxn") - .withDescription("icokpv")) - .withOrigin("lqtmldgxob"), - new OperationDetailInner() - .withName("rclnpkc") - .withIsDataAction(false) - .withDisplay( - new OperationDisplay() - .withProvider("iykhy") - .withResource("fvjlboxqvkjlmx") - .withOperation("mdy") - .withDescription("dwdigumb")) - .withOrigin("aauzzptjazysd"))) - .withNextLink("ezwwv"); - model = BinaryData.fromObject(model).toObject(AvailableOperations.class); - Assertions.assertEquals("kambtrnegvmnvuqe", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("pa", model.value().get(0).display().provider()); - Assertions.assertEquals("jbkkdmflvestmjl", model.value().get(0).display().resource()); - Assertions.assertEquals("ril", model.value().get(0).display().operation()); - Assertions.assertEquals("apeewchpxlkt", model.value().get(0).display().description()); - Assertions.assertEquals("uziycsl", model.value().get(0).origin()); - Assertions.assertEquals("ezwwv", model.nextLink()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfileInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfileInnerTests.java deleted file mode 100644 index 6da5265f95134..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfileInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AvailableWorkloadProfileInner; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; -import com.azure.resourcemanager.appcontainers.models.Category; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AvailableWorkloadProfileInnerTests { - @Test - public void testDeserialize() { - AvailableWorkloadProfileInner model = - BinaryData - .fromString( - "{\"location\":\"ruzslzoj\",\"properties\":{\"billingMeterCategory\":\"PremiumSkuMemoryOptimized\",\"applicability\":\"Custom\",\"cores\":1500212037,\"memoryGiB\":1889500647,\"displayName\":\"ngfdgugeyzihgrky\"},\"id\":\"zabs\",\"name\":\"mfp\",\"type\":\"hojeevy\"}") - .toObject(AvailableWorkloadProfileInner.class); - Assertions.assertEquals("ruzslzoj", model.location()); - Assertions.assertEquals(Category.PREMIUM_SKU_MEMORY_OPTIMIZED, model.properties().billingMeterCategory()); - Assertions.assertEquals(Applicability.CUSTOM, model.properties().applicability()); - Assertions.assertEquals(1500212037, model.properties().cores()); - Assertions.assertEquals(1889500647, model.properties().memoryGiB()); - Assertions.assertEquals("ngfdgugeyzihgrky", model.properties().displayName()); - } - - @Test - public void testSerialize() { - AvailableWorkloadProfileInner model = - new AvailableWorkloadProfileInner() - .withLocation("ruzslzoj") - .withProperties( - new AvailableWorkloadProfileProperties() - .withBillingMeterCategory(Category.PREMIUM_SKU_MEMORY_OPTIMIZED) - .withApplicability(Applicability.CUSTOM) - .withCores(1500212037) - .withMemoryGiB(1889500647) - .withDisplayName("ngfdgugeyzihgrky")); - model = BinaryData.fromObject(model).toObject(AvailableWorkloadProfileInner.class); - Assertions.assertEquals("ruzslzoj", model.location()); - Assertions.assertEquals(Category.PREMIUM_SKU_MEMORY_OPTIMIZED, model.properties().billingMeterCategory()); - Assertions.assertEquals(Applicability.CUSTOM, model.properties().applicability()); - Assertions.assertEquals(1500212037, model.properties().cores()); - Assertions.assertEquals(1889500647, model.properties().memoryGiB()); - Assertions.assertEquals("ngfdgugeyzihgrky", model.properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilePropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilePropertiesTests.java deleted file mode 100644 index 1d1c287b08cc2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilePropertiesTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; -import com.azure.resourcemanager.appcontainers.models.Category; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AvailableWorkloadProfilePropertiesTests { - @Test - public void testDeserialize() { - AvailableWorkloadProfileProperties model = - BinaryData - .fromString( - "{\"billingMeterCategory\":\"PremiumSkuGeneralPurpose\",\"applicability\":\"LocationDefault\",\"cores\":1792442027,\"memoryGiB\":296401749,\"displayName\":\"gomfgbeglq\"}") - .toObject(AvailableWorkloadProfileProperties.class); - Assertions.assertEquals(Category.PREMIUM_SKU_GENERAL_PURPOSE, model.billingMeterCategory()); - Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.applicability()); - Assertions.assertEquals(1792442027, model.cores()); - Assertions.assertEquals(296401749, model.memoryGiB()); - Assertions.assertEquals("gomfgbeglq", model.displayName()); - } - - @Test - public void testSerialize() { - AvailableWorkloadProfileProperties model = - new AvailableWorkloadProfileProperties() - .withBillingMeterCategory(Category.PREMIUM_SKU_GENERAL_PURPOSE) - .withApplicability(Applicability.LOCATION_DEFAULT) - .withCores(1792442027) - .withMemoryGiB(296401749) - .withDisplayName("gomfgbeglq"); - model = BinaryData.fromObject(model).toObject(AvailableWorkloadProfileProperties.class); - Assertions.assertEquals(Category.PREMIUM_SKU_GENERAL_PURPOSE, model.billingMeterCategory()); - Assertions.assertEquals(Applicability.LOCATION_DEFAULT, model.applicability()); - Assertions.assertEquals(1792442027, model.cores()); - Assertions.assertEquals(296401749, model.memoryGiB()); - Assertions.assertEquals("gomfgbeglq", model.displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesCollectionTests.java deleted file mode 100644 index da7e816f2cf12..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesCollectionTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.AvailableWorkloadProfileInner; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfileProperties; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfilesCollection; -import com.azure.resourcemanager.appcontainers.models.Category; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AvailableWorkloadProfilesCollectionTests { - @Test - public void testDeserialize() { - AvailableWorkloadProfilesCollection model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"psttexoq\",\"properties\":{\"billingMeterCategory\":\"PremiumSkuGeneralPurpose\",\"applicability\":\"Custom\",\"cores\":402556977,\"memoryGiB\":130119392,\"displayName\":\"uncuw\"},\"id\":\"spkcdqzh\",\"name\":\"ctddun\",\"type\":\"ndy\"},{\"location\":\"chrqb\",\"properties\":{\"billingMeterCategory\":\"PremiumSkuGeneralPurpose\",\"applicability\":\"Custom\",\"cores\":1318617256,\"memoryGiB\":4442645,\"displayName\":\"wboxjumvqqo\"},\"id\":\"hrraiouaubrj\",\"name\":\"loqxfuojrngif\",\"type\":\"rzpasccbiuimzdly\"}],\"nextLink\":\"fqwmkyoquf\"}") - .toObject(AvailableWorkloadProfilesCollection.class); - Assertions.assertEquals("psttexoq", model.value().get(0).location()); - Assertions - .assertEquals( - Category.PREMIUM_SKU_GENERAL_PURPOSE, model.value().get(0).properties().billingMeterCategory()); - Assertions.assertEquals(Applicability.CUSTOM, model.value().get(0).properties().applicability()); - Assertions.assertEquals(402556977, model.value().get(0).properties().cores()); - Assertions.assertEquals(130119392, model.value().get(0).properties().memoryGiB()); - Assertions.assertEquals("uncuw", model.value().get(0).properties().displayName()); - } - - @Test - public void testSerialize() { - AvailableWorkloadProfilesCollection model = - new AvailableWorkloadProfilesCollection() - .withValue( - Arrays - .asList( - new AvailableWorkloadProfileInner() - .withLocation("psttexoq") - .withProperties( - new AvailableWorkloadProfileProperties() - .withBillingMeterCategory(Category.PREMIUM_SKU_GENERAL_PURPOSE) - .withApplicability(Applicability.CUSTOM) - .withCores(402556977) - .withMemoryGiB(130119392) - .withDisplayName("uncuw")), - new AvailableWorkloadProfileInner() - .withLocation("chrqb") - .withProperties( - new AvailableWorkloadProfileProperties() - .withBillingMeterCategory(Category.PREMIUM_SKU_GENERAL_PURPOSE) - .withApplicability(Applicability.CUSTOM) - .withCores(1318617256) - .withMemoryGiB(4442645) - .withDisplayName("wboxjumvqqo")))); - model = BinaryData.fromObject(model).toObject(AvailableWorkloadProfilesCollection.class); - Assertions.assertEquals("psttexoq", model.value().get(0).location()); - Assertions - .assertEquals( - Category.PREMIUM_SKU_GENERAL_PURPOSE, model.value().get(0).properties().billingMeterCategory()); - Assertions.assertEquals(Applicability.CUSTOM, model.value().get(0).properties().applicability()); - Assertions.assertEquals(402556977, model.value().get(0).properties().cores()); - Assertions.assertEquals(130119392, model.value().get(0).properties().memoryGiB()); - Assertions.assertEquals("uncuw", model.value().get(0).properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetMockTests.java deleted file mode 100644 index 052ac47bc556b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AvailableWorkloadProfilesGetMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Applicability; -import com.azure.resourcemanager.appcontainers.models.AvailableWorkloadProfile; -import com.azure.resourcemanager.appcontainers.models.Category; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AvailableWorkloadProfilesGetMockTests { - @Test - public void testGet() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"idmhmwf\",\"properties\":{\"billingMeterCategory\":\"PremiumSkuComputeOptimized\",\"applicability\":\"LocationDefault\",\"cores\":411481219,\"memoryGiB\":323271862,\"displayName\":\"ccrrvweyoxoyyu\"},\"id\":\"haim\",\"name\":\"oir\",\"type\":\"qboshbra\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.availableWorkloadProfiles().get("wwgbdv", Context.NONE); - - Assertions.assertEquals("idmhmwf", response.iterator().next().location()); - Assertions - .assertEquals( - Category.PREMIUM_SKU_COMPUTE_OPTIMIZED, response.iterator().next().properties().billingMeterCategory()); - Assertions - .assertEquals(Applicability.LOCATION_DEFAULT, response.iterator().next().properties().applicability()); - Assertions.assertEquals(411481219, response.iterator().next().properties().cores()); - Assertions.assertEquals(323271862, response.iterator().next().properties().memoryGiB()); - Assertions.assertEquals("ccrrvweyoxoyyu", response.iterator().next().properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryLoginTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryLoginTests.java deleted file mode 100644 index e0b3f0df78733..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryLoginTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryLogin; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureActiveDirectoryLoginTests { - @Test - public void testDeserialize() { - AzureActiveDirectoryLogin model = - BinaryData - .fromString("{\"loginParameters\":[\"eju\"],\"disableWWWAuthenticate\":true}") - .toObject(AzureActiveDirectoryLogin.class); - Assertions.assertEquals("eju", model.loginParameters().get(0)); - Assertions.assertEquals(true, model.disableWwwAuthenticate()); - } - - @Test - public void testSerialize() { - AzureActiveDirectoryLogin model = - new AzureActiveDirectoryLogin().withLoginParameters(Arrays.asList("eju")).withDisableWwwAuthenticate(true); - model = BinaryData.fromObject(model).toObject(AzureActiveDirectoryLogin.class); - Assertions.assertEquals("eju", model.loginParameters().get(0)); - Assertions.assertEquals(true, model.disableWwwAuthenticate()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryRegistrationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryRegistrationTests.java deleted file mode 100644 index 59a59d6c4bc42..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryRegistrationTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryRegistration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureActiveDirectoryRegistrationTests { - @Test - public void testDeserialize() { - AzureActiveDirectoryRegistration model = - BinaryData - .fromString( - "{\"openIdIssuer\":\"ddgmb\",\"clientId\":\"ex\",\"clientSecretSettingName\":\"bhtqqrolfpfpsa\",\"clientSecretCertificateThumbprint\":\"bquxigjy\",\"clientSecretCertificateSubjectAlternativeName\":\"zjaoyfhrtxil\",\"clientSecretCertificateIssuer\":\"rkujy\"}") - .toObject(AzureActiveDirectoryRegistration.class); - Assertions.assertEquals("ddgmb", model.openIdIssuer()); - Assertions.assertEquals("ex", model.clientId()); - Assertions.assertEquals("bhtqqrolfpfpsa", model.clientSecretSettingName()); - Assertions.assertEquals("bquxigjy", model.clientSecretCertificateThumbprint()); - Assertions.assertEquals("zjaoyfhrtxil", model.clientSecretCertificateSubjectAlternativeName()); - Assertions.assertEquals("rkujy", model.clientSecretCertificateIssuer()); - } - - @Test - public void testSerialize() { - AzureActiveDirectoryRegistration model = - new AzureActiveDirectoryRegistration() - .withOpenIdIssuer("ddgmb") - .withClientId("ex") - .withClientSecretSettingName("bhtqqrolfpfpsa") - .withClientSecretCertificateThumbprint("bquxigjy") - .withClientSecretCertificateSubjectAlternativeName("zjaoyfhrtxil") - .withClientSecretCertificateIssuer("rkujy"); - model = BinaryData.fromObject(model).toObject(AzureActiveDirectoryRegistration.class); - Assertions.assertEquals("ddgmb", model.openIdIssuer()); - Assertions.assertEquals("ex", model.clientId()); - Assertions.assertEquals("bhtqqrolfpfpsa", model.clientSecretSettingName()); - Assertions.assertEquals("bquxigjy", model.clientSecretCertificateThumbprint()); - Assertions.assertEquals("zjaoyfhrtxil", model.clientSecretCertificateSubjectAlternativeName()); - Assertions.assertEquals("rkujy", model.clientSecretCertificateIssuer()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryTests.java deleted file mode 100644 index 0b1d3c18501ef..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectory; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryLogin; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryRegistration; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryValidation; -import com.azure.resourcemanager.appcontainers.models.DefaultAuthorizationPolicy; -import com.azure.resourcemanager.appcontainers.models.JwtClaimChecks; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureActiveDirectoryTests { - @Test - public void testDeserialize() { - AzureActiveDirectory model = - BinaryData - .fromString( - "{\"enabled\":false,\"registration\":{\"openIdIssuer\":\"pdappds\",\"clientId\":\"kvwrwjfeu\",\"clientSecretSettingName\":\"hutje\",\"clientSecretCertificateThumbprint\":\"mrldhu\",\"clientSecretCertificateSubjectAlternativeName\":\"zzd\",\"clientSecretCertificateIssuer\":\"qxhocdgeablgphut\"},\"login\":{\"loginParameters\":[\"vkaozwyiftyhxhur\",\"k\"],\"disableWWWAuthenticate\":false},\"validation\":{\"jwtClaimChecks\":{\"allowedGroups\":[\"iwpwcuk\",\"fkgiawxk\",\"ryplwckbasyypn\"],\"allowedClientApplications\":[\"sgcbac\",\"hejkotynqgou\",\"zndlikwy\",\"kgfg\"]},\"allowedAudiences\":[\"adgakeqsrxybz\",\"qedqytbciqfoufl\",\"mnkzsmod\",\"glougpbk\"],\"defaultAuthorizationPolicy\":{\"allowedApplications\":[\"duqkt\",\"pspwgcuertu\",\"kdosvqw\",\"bmdg\"]}},\"isAutoProvisioned\":true}") - .toObject(AzureActiveDirectory.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("pdappds", model.registration().openIdIssuer()); - Assertions.assertEquals("kvwrwjfeu", model.registration().clientId()); - Assertions.assertEquals("hutje", model.registration().clientSecretSettingName()); - Assertions.assertEquals("mrldhu", model.registration().clientSecretCertificateThumbprint()); - Assertions.assertEquals("zzd", model.registration().clientSecretCertificateSubjectAlternativeName()); - Assertions.assertEquals("qxhocdgeablgphut", model.registration().clientSecretCertificateIssuer()); - Assertions.assertEquals("vkaozwyiftyhxhur", model.login().loginParameters().get(0)); - Assertions.assertEquals(false, model.login().disableWwwAuthenticate()); - Assertions.assertEquals("iwpwcuk", model.validation().jwtClaimChecks().allowedGroups().get(0)); - Assertions.assertEquals("sgcbac", model.validation().jwtClaimChecks().allowedClientApplications().get(0)); - Assertions.assertEquals("adgakeqsrxybz", model.validation().allowedAudiences().get(0)); - Assertions.assertEquals("duqkt", model.validation().defaultAuthorizationPolicy().allowedApplications().get(0)); - Assertions.assertEquals(true, model.isAutoProvisioned()); - } - - @Test - public void testSerialize() { - AzureActiveDirectory model = - new AzureActiveDirectory() - .withEnabled(false) - .withRegistration( - new AzureActiveDirectoryRegistration() - .withOpenIdIssuer("pdappds") - .withClientId("kvwrwjfeu") - .withClientSecretSettingName("hutje") - .withClientSecretCertificateThumbprint("mrldhu") - .withClientSecretCertificateSubjectAlternativeName("zzd") - .withClientSecretCertificateIssuer("qxhocdgeablgphut")) - .withLogin( - new AzureActiveDirectoryLogin() - .withLoginParameters(Arrays.asList("vkaozwyiftyhxhur", "k")) - .withDisableWwwAuthenticate(false)) - .withValidation( - new AzureActiveDirectoryValidation() - .withJwtClaimChecks( - new JwtClaimChecks() - .withAllowedGroups(Arrays.asList("iwpwcuk", "fkgiawxk", "ryplwckbasyypn")) - .withAllowedClientApplications( - Arrays.asList("sgcbac", "hejkotynqgou", "zndlikwy", "kgfg"))) - .withAllowedAudiences(Arrays.asList("adgakeqsrxybz", "qedqytbciqfoufl", "mnkzsmod", "glougpbk")) - .withDefaultAuthorizationPolicy( - new DefaultAuthorizationPolicy() - .withAllowedApplications(Arrays.asList("duqkt", "pspwgcuertu", "kdosvqw", "bmdg")))) - .withIsAutoProvisioned(true); - model = BinaryData.fromObject(model).toObject(AzureActiveDirectory.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("pdappds", model.registration().openIdIssuer()); - Assertions.assertEquals("kvwrwjfeu", model.registration().clientId()); - Assertions.assertEquals("hutje", model.registration().clientSecretSettingName()); - Assertions.assertEquals("mrldhu", model.registration().clientSecretCertificateThumbprint()); - Assertions.assertEquals("zzd", model.registration().clientSecretCertificateSubjectAlternativeName()); - Assertions.assertEquals("qxhocdgeablgphut", model.registration().clientSecretCertificateIssuer()); - Assertions.assertEquals("vkaozwyiftyhxhur", model.login().loginParameters().get(0)); - Assertions.assertEquals(false, model.login().disableWwwAuthenticate()); - Assertions.assertEquals("iwpwcuk", model.validation().jwtClaimChecks().allowedGroups().get(0)); - Assertions.assertEquals("sgcbac", model.validation().jwtClaimChecks().allowedClientApplications().get(0)); - Assertions.assertEquals("adgakeqsrxybz", model.validation().allowedAudiences().get(0)); - Assertions.assertEquals("duqkt", model.validation().defaultAuthorizationPolicy().allowedApplications().get(0)); - Assertions.assertEquals(true, model.isAutoProvisioned()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryValidationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryValidationTests.java deleted file mode 100644 index 92d5eb1aa61a5..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureActiveDirectoryValidationTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedPrincipals; -import com.azure.resourcemanager.appcontainers.models.AzureActiveDirectoryValidation; -import com.azure.resourcemanager.appcontainers.models.DefaultAuthorizationPolicy; -import com.azure.resourcemanager.appcontainers.models.JwtClaimChecks; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureActiveDirectoryValidationTests { - @Test - public void testDeserialize() { - AzureActiveDirectoryValidation model = - BinaryData - .fromString( - "{\"jwtClaimChecks\":{\"allowedGroups\":[\"lyxwjkcprbnwbx\",\"jvtbvpyss\",\"dnrujqguhmuouqfp\",\"wzwbnguitn\"],\"allowedClientApplications\":[\"zga\",\"x\"]},\"allowedAudiences\":[\"zuckyfi\",\"rfidfvzwdz\",\"htymw\",\"sdkf\"],\"defaultAuthorizationPolicy\":{\"allowedPrincipals\":{\"groups\":[\"nteiwaopv\",\"mijcmmxdcufufs\"],\"identities\":[\"mzidnsezcxtb\",\"sgfyccsnew\"]},\"allowedApplications\":[\"z\",\"eiachboosflnr\"]}}") - .toObject(AzureActiveDirectoryValidation.class); - Assertions.assertEquals("lyxwjkcprbnwbx", model.jwtClaimChecks().allowedGroups().get(0)); - Assertions.assertEquals("zga", model.jwtClaimChecks().allowedClientApplications().get(0)); - Assertions.assertEquals("zuckyfi", model.allowedAudiences().get(0)); - Assertions.assertEquals("nteiwaopv", model.defaultAuthorizationPolicy().allowedPrincipals().groups().get(0)); - Assertions - .assertEquals("mzidnsezcxtb", model.defaultAuthorizationPolicy().allowedPrincipals().identities().get(0)); - Assertions.assertEquals("z", model.defaultAuthorizationPolicy().allowedApplications().get(0)); - } - - @Test - public void testSerialize() { - AzureActiveDirectoryValidation model = - new AzureActiveDirectoryValidation() - .withJwtClaimChecks( - new JwtClaimChecks() - .withAllowedGroups( - Arrays.asList("lyxwjkcprbnwbx", "jvtbvpyss", "dnrujqguhmuouqfp", "wzwbnguitn")) - .withAllowedClientApplications(Arrays.asList("zga", "x"))) - .withAllowedAudiences(Arrays.asList("zuckyfi", "rfidfvzwdz", "htymw", "sdkf")) - .withDefaultAuthorizationPolicy( - new DefaultAuthorizationPolicy() - .withAllowedPrincipals( - new AllowedPrincipals() - .withGroups(Arrays.asList("nteiwaopv", "mijcmmxdcufufs")) - .withIdentities(Arrays.asList("mzidnsezcxtb", "sgfyccsnew"))) - .withAllowedApplications(Arrays.asList("z", "eiachboosflnr"))); - model = BinaryData.fromObject(model).toObject(AzureActiveDirectoryValidation.class); - Assertions.assertEquals("lyxwjkcprbnwbx", model.jwtClaimChecks().allowedGroups().get(0)); - Assertions.assertEquals("zga", model.jwtClaimChecks().allowedClientApplications().get(0)); - Assertions.assertEquals("zuckyfi", model.allowedAudiences().get(0)); - Assertions.assertEquals("nteiwaopv", model.defaultAuthorizationPolicy().allowedPrincipals().groups().get(0)); - Assertions - .assertEquals("mzidnsezcxtb", model.defaultAuthorizationPolicy().allowedPrincipals().identities().get(0)); - Assertions.assertEquals("z", model.defaultAuthorizationPolicy().allowedApplications().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsRegistrationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsRegistrationTests.java deleted file mode 100644 index 900228f67613f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsRegistrationTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebAppsRegistration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureStaticWebAppsRegistrationTests { - @Test - public void testDeserialize() { - AzureStaticWebAppsRegistration model = - BinaryData.fromString("{\"clientId\":\"cpecfvmmcoofs\"}").toObject(AzureStaticWebAppsRegistration.class); - Assertions.assertEquals("cpecfvmmcoofs", model.clientId()); - } - - @Test - public void testSerialize() { - AzureStaticWebAppsRegistration model = new AzureStaticWebAppsRegistration().withClientId("cpecfvmmcoofs"); - model = BinaryData.fromObject(model).toObject(AzureStaticWebAppsRegistration.class); - Assertions.assertEquals("cpecfvmmcoofs", model.clientId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsTests.java deleted file mode 100644 index 3924480b27324..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/AzureStaticWebAppsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebApps; -import com.azure.resourcemanager.appcontainers.models.AzureStaticWebAppsRegistration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class AzureStaticWebAppsTests { - @Test - public void testDeserialize() { - AzureStaticWebApps model = - BinaryData - .fromString("{\"enabled\":true,\"registration\":{\"clientId\":\"gpphrcgyn\"}}") - .toObject(AzureStaticWebApps.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("gpphrcgyn", model.registration().clientId()); - } - - @Test - public void testSerialize() { - AzureStaticWebApps model = - new AzureStaticWebApps() - .withEnabled(true) - .withRegistration(new AzureStaticWebAppsRegistration().withClientId("gpphrcgyn")); - model = BinaryData.fromObject(model).toObject(AzureStaticWebApps.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("gpphrcgyn", model.registration().clientId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BaseContainerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BaseContainerTests.java deleted file mode 100644 index ca32730bb6730..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BaseContainerTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BaseContainer; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; -import com.azure.resourcemanager.appcontainers.models.VolumeMount; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BaseContainerTests { - @Test - public void testDeserialize() { - BaseContainer model = - BinaryData - .fromString( - "{\"image\":\"wmgxcxrsl\",\"name\":\"utwu\",\"command\":[\"rpkhjwn\",\"yqsluic\",\"dggkzzlvmbmpa\"],\"args\":[\"dfvue\",\"yw\",\"bpfvm\"],\"env\":[{\"name\":\"fouyf\",\"value\":\"akcp\",\"secretRef\":\"yzvqt\"},{\"name\":\"ubex\",\"value\":\"zksmondj\",\"secretRef\":\"uxvypomgkopkwh\"}],\"resources\":{\"cpu\":52.49920535887086,\"memory\":\"qgxy\",\"ephemeralStorage\":\"ocmbqfqvmkcxoza\"},\"volumeMounts\":[{\"volumeName\":\"lxprglyatddckcbc\",\"mountPath\":\"jrjxgciqibrhosx\"},{\"volumeName\":\"qrhzoymibmrqyib\",\"mountPath\":\"wfluszdt\"},{\"volumeName\":\"rkwofyyvoqa\",\"mountPath\":\"iexpbtgiwbwo\"}]}") - .toObject(BaseContainer.class); - Assertions.assertEquals("wmgxcxrsl", model.image()); - Assertions.assertEquals("utwu", model.name()); - Assertions.assertEquals("rpkhjwn", model.command().get(0)); - Assertions.assertEquals("dfvue", model.args().get(0)); - Assertions.assertEquals("fouyf", model.env().get(0).name()); - Assertions.assertEquals("akcp", model.env().get(0).value()); - Assertions.assertEquals("yzvqt", model.env().get(0).secretRef()); - Assertions.assertEquals(52.49920535887086D, model.resources().cpu()); - Assertions.assertEquals("qgxy", model.resources().memory()); - Assertions.assertEquals("lxprglyatddckcbc", model.volumeMounts().get(0).volumeName()); - Assertions.assertEquals("jrjxgciqibrhosx", model.volumeMounts().get(0).mountPath()); - } - - @Test - public void testSerialize() { - BaseContainer model = - new BaseContainer() - .withImage("wmgxcxrsl") - .withName("utwu") - .withCommand(Arrays.asList("rpkhjwn", "yqsluic", "dggkzzlvmbmpa")) - .withArgs(Arrays.asList("dfvue", "yw", "bpfvm")) - .withEnv( - Arrays - .asList( - new EnvironmentVar().withName("fouyf").withValue("akcp").withSecretRef("yzvqt"), - new EnvironmentVar() - .withName("ubex") - .withValue("zksmondj") - .withSecretRef("uxvypomgkopkwh"))) - .withResources(new ContainerResources().withCpu(52.49920535887086D).withMemory("qgxy")) - .withVolumeMounts( - Arrays - .asList( - new VolumeMount().withVolumeName("lxprglyatddckcbc").withMountPath("jrjxgciqibrhosx"), - new VolumeMount().withVolumeName("qrhzoymibmrqyib").withMountPath("wfluszdt"), - new VolumeMount().withVolumeName("rkwofyyvoqa").withMountPath("iexpbtgiwbwo"))); - model = BinaryData.fromObject(model).toObject(BaseContainer.class); - Assertions.assertEquals("wmgxcxrsl", model.image()); - Assertions.assertEquals("utwu", model.name()); - Assertions.assertEquals("rpkhjwn", model.command().get(0)); - Assertions.assertEquals("dfvue", model.args().get(0)); - Assertions.assertEquals("fouyf", model.env().get(0).name()); - Assertions.assertEquals("akcp", model.env().get(0).value()); - Assertions.assertEquals("yzvqt", model.env().get(0).secretRef()); - Assertions.assertEquals(52.49920535887086D, model.resources().cpu()); - Assertions.assertEquals("qgxy", model.resources().memory()); - Assertions.assertEquals("lxprglyatddckcbc", model.volumeMounts().get(0).volumeName()); - Assertions.assertEquals("jrjxgciqibrhosx", model.volumeMounts().get(0).mountPath()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterCollectionInnerTests.java deleted file mode 100644 index e7bd249fa4fcf..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterCollectionInnerTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.BillingMeterCollectionInner; -import com.azure.resourcemanager.appcontainers.models.BillingMeter; -import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties; -import com.azure.resourcemanager.appcontainers.models.Category; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BillingMeterCollectionInnerTests { - @Test - public void testDeserialize() { - BillingMeterCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"o\",\"properties\":{\"category\":\"PremiumSkuComputeOptimized\",\"meterType\":\"nlu\",\"displayName\":\"krrfx\"},\"id\":\"ebtijvacvbmqzbqq\",\"name\":\"lajrnwxacevehj\",\"type\":\"uyxoaf\"},{\"location\":\"oqltfae\",\"properties\":{\"category\":\"PremiumSkuMemoryOptimized\",\"meterType\":\"fgvxirpghriypoqe\",\"displayName\":\"lqhykprlpyz\"},\"id\":\"ciqdsme\",\"name\":\"iitdfuxt\",\"type\":\"asiibmiybnnust\"},{\"location\":\"ljhnmgixhcmav\",\"properties\":{\"category\":\"PremiumSkuMemoryOptimized\",\"meterType\":\"dorhcgyyp\",\"displayName\":\"twypundmbxh\"},\"id\":\"cmjkavlgorbmftpm\",\"name\":\"tzfjltf\",\"type\":\"nzcyjtotp\"},{\"location\":\"pvpbdbzqgqqiheds\",\"properties\":{\"category\":\"PremiumSkuMemoryOptimized\",\"meterType\":\"mkyi\",\"displayName\":\"ysi\"},\"id\":\"gqcwdhohsdtmc\",\"name\":\"zsu\",\"type\":\"cohdx\"}]}") - .toObject(BillingMeterCollectionInner.class); - Assertions.assertEquals("o", model.value().get(0).location()); - Assertions.assertEquals(Category.PREMIUM_SKU_COMPUTE_OPTIMIZED, model.value().get(0).properties().category()); - Assertions.assertEquals("nlu", model.value().get(0).properties().meterType()); - Assertions.assertEquals("krrfx", model.value().get(0).properties().displayName()); - } - - @Test - public void testSerialize() { - BillingMeterCollectionInner model = - new BillingMeterCollectionInner() - .withValue( - Arrays - .asList( - new BillingMeter() - .withLocation("o") - .withProperties( - new BillingMeterProperties() - .withCategory(Category.PREMIUM_SKU_COMPUTE_OPTIMIZED) - .withMeterType("nlu") - .withDisplayName("krrfx")), - new BillingMeter() - .withLocation("oqltfae") - .withProperties( - new BillingMeterProperties() - .withCategory(Category.PREMIUM_SKU_MEMORY_OPTIMIZED) - .withMeterType("fgvxirpghriypoqe") - .withDisplayName("lqhykprlpyz")), - new BillingMeter() - .withLocation("ljhnmgixhcmav") - .withProperties( - new BillingMeterProperties() - .withCategory(Category.PREMIUM_SKU_MEMORY_OPTIMIZED) - .withMeterType("dorhcgyyp") - .withDisplayName("twypundmbxh")), - new BillingMeter() - .withLocation("pvpbdbzqgqqiheds") - .withProperties( - new BillingMeterProperties() - .withCategory(Category.PREMIUM_SKU_MEMORY_OPTIMIZED) - .withMeterType("mkyi") - .withDisplayName("ysi")))); - model = BinaryData.fromObject(model).toObject(BillingMeterCollectionInner.class); - Assertions.assertEquals("o", model.value().get(0).location()); - Assertions.assertEquals(Category.PREMIUM_SKU_COMPUTE_OPTIMIZED, model.value().get(0).properties().category()); - Assertions.assertEquals("nlu", model.value().get(0).properties().meterType()); - Assertions.assertEquals("krrfx", model.value().get(0).properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterPropertiesTests.java deleted file mode 100644 index 1e151c8e438a4..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties; -import com.azure.resourcemanager.appcontainers.models.Category; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BillingMeterPropertiesTests { - @Test - public void testDeserialize() { - BillingMeterProperties model = - BinaryData - .fromString( - "{\"category\":\"PremiumSkuGeneralPurpose\",\"meterType\":\"eqocljmygvk\",\"displayName\":\"kjjeokbz\"}") - .toObject(BillingMeterProperties.class); - Assertions.assertEquals(Category.PREMIUM_SKU_GENERAL_PURPOSE, model.category()); - Assertions.assertEquals("eqocljmygvk", model.meterType()); - Assertions.assertEquals("kjjeokbz", model.displayName()); - } - - @Test - public void testSerialize() { - BillingMeterProperties model = - new BillingMeterProperties() - .withCategory(Category.PREMIUM_SKU_GENERAL_PURPOSE) - .withMeterType("eqocljmygvk") - .withDisplayName("kjjeokbz"); - model = BinaryData.fromObject(model).toObject(BillingMeterProperties.class); - Assertions.assertEquals(Category.PREMIUM_SKU_GENERAL_PURPOSE, model.category()); - Assertions.assertEquals("eqocljmygvk", model.meterType()); - Assertions.assertEquals("kjjeokbz", model.displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterTests.java deleted file mode 100644 index c35f18e825ce9..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/BillingMeterTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BillingMeter; -import com.azure.resourcemanager.appcontainers.models.BillingMeterProperties; -import com.azure.resourcemanager.appcontainers.models.Category; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class BillingMeterTests { - @Test - public void testDeserialize() { - BillingMeter model = - BinaryData - .fromString( - "{\"location\":\"lm\",\"properties\":{\"category\":\"PremiumSkuComputeOptimized\",\"meterType\":\"cvhd\",\"displayName\":\"v\"},\"id\":\"qxeysko\",\"name\":\"qzinkfkbg\",\"type\":\"z\"}") - .toObject(BillingMeter.class); - Assertions.assertEquals("lm", model.location()); - Assertions.assertEquals(Category.PREMIUM_SKU_COMPUTE_OPTIMIZED, model.properties().category()); - Assertions.assertEquals("cvhd", model.properties().meterType()); - Assertions.assertEquals("v", model.properties().displayName()); - } - - @Test - public void testSerialize() { - BillingMeter model = - new BillingMeter() - .withLocation("lm") - .withProperties( - new BillingMeterProperties() - .withCategory(Category.PREMIUM_SKU_COMPUTE_OPTIMIZED) - .withMeterType("cvhd") - .withDisplayName("v")); - model = BinaryData.fromObject(model).toObject(BillingMeter.class); - Assertions.assertEquals("lm", model.location()); - Assertions.assertEquals(Category.PREMIUM_SKU_COMPUTE_OPTIMIZED, model.properties().category()); - Assertions.assertEquals("cvhd", model.properties().meterType()); - Assertions.assertEquals("v", model.properties().displayName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatePatchTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatePatchTests.java deleted file mode 100644 index 11d95a597703e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CertificatePatchTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CertificatePatch; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CertificatePatchTests { - @Test - public void testDeserialize() { - CertificatePatch model = - BinaryData - .fromString( - "{\"tags\":{\"jc\":\"gkbugrjqct\",\"cuplcplcwkhih\":\"isofieypefojyqd\",\"cjhfgmvecactxmw\":\"hlhzdsqtzbsrgno\",\"ovekqvgqouwi\":\"teyowclu\"}}") - .toObject(CertificatePatch.class); - Assertions.assertEquals("gkbugrjqct", model.tags().get("jc")); - } - - @Test - public void testSerialize() { - CertificatePatch model = - new CertificatePatch() - .withTags( - mapOf( - "jc", - "gkbugrjqct", - "cuplcplcwkhih", - "isofieypefojyqd", - "cjhfgmvecactxmw", - "hlhzdsqtzbsrgno", - "ovekqvgqouwi", - "teyowclu")); - model = BinaryData.fromObject(model).toObject(CertificatePatch.class); - Assertions.assertEquals("gkbugrjqct", model.tags().get("jc")); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityRequestTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityRequestTests.java deleted file mode 100644 index 2f76d29ef3eaa..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityRequestTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityRequest; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CheckNameAvailabilityRequestTests { - @Test - public void testDeserialize() { - CheckNameAvailabilityRequest model = - BinaryData - .fromString("{\"name\":\"mpjw\",\"type\":\"vqikfxcvhrfsphu\"}") - .toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("mpjw", model.name()); - Assertions.assertEquals("vqikfxcvhrfsphu", model.type()); - } - - @Test - public void testSerialize() { - CheckNameAvailabilityRequest model = - new CheckNameAvailabilityRequest().withName("mpjw").withType("vqikfxcvhrfsphu"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityRequest.class); - Assertions.assertEquals("mpjw", model.name()); - Assertions.assertEquals("vqikfxcvhrfsphu", model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityResponseInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityResponseInnerTests.java deleted file mode 100644 index 5da5bcd5937f2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CheckNameAvailabilityResponseInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.CheckNameAvailabilityResponseInner; -import com.azure.resourcemanager.appcontainers.models.CheckNameAvailabilityReason; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CheckNameAvailabilityResponseInnerTests { - @Test - public void testDeserialize() { - CheckNameAvailabilityResponseInner model = - BinaryData - .fromString("{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"kteusqczk\"}") - .toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("kteusqczk", model.message()); - } - - @Test - public void testSerialize() { - CheckNameAvailabilityResponseInner model = - new CheckNameAvailabilityResponseInner() - .withNameAvailable(true) - .withReason(CheckNameAvailabilityReason.ALREADY_EXISTS) - .withMessage("kteusqczk"); - model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityResponseInner.class); - Assertions.assertEquals(true, model.nameAvailable()); - Assertions.assertEquals(CheckNameAvailabilityReason.ALREADY_EXISTS, model.reason()); - Assertions.assertEquals("kteusqczk", model.message()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ClientRegistrationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ClientRegistrationTests.java deleted file mode 100644 index fed359577d5cd..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ClientRegistrationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ClientRegistration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ClientRegistrationTests { - @Test - public void testDeserialize() { - ClientRegistration model = - BinaryData - .fromString("{\"clientId\":\"ocjjxhvpmouexh\",\"clientSecretSettingName\":\"xibqeojnx\"}") - .toObject(ClientRegistration.class); - Assertions.assertEquals("ocjjxhvpmouexh", model.clientId()); - Assertions.assertEquals("xibqeojnx", model.clientSecretSettingName()); - } - - @Test - public void testSerialize() { - ClientRegistration model = - new ClientRegistration().withClientId("ocjjxhvpmouexh").withClientSecretSettingName("xibqeojnx"); - model = BinaryData.fromObject(model).toObject(ClientRegistration.class); - Assertions.assertEquals("ocjjxhvpmouexh", model.clientId()); - Assertions.assertEquals("xibqeojnx", model.clientSecretSettingName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConfigurationTests.java deleted file mode 100644 index f8f5a94b6854b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConfigurationTests.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Action; -import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; -import com.azure.resourcemanager.appcontainers.models.AppProtocol; -import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.Configuration; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import com.azure.resourcemanager.appcontainers.models.Dapr; -import com.azure.resourcemanager.appcontainers.models.Ingress; -import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; -import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; -import com.azure.resourcemanager.appcontainers.models.LogLevel; -import com.azure.resourcemanager.appcontainers.models.RegistryCredentials; -import com.azure.resourcemanager.appcontainers.models.Secret; -import com.azure.resourcemanager.appcontainers.models.TrafficWeight; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ConfigurationTests { - @Test - public void testDeserialize() { - Configuration model = - BinaryData - .fromString( - "{\"secrets\":[{\"name\":\"kn\",\"value\":\"scwsv\"},{\"name\":\"otogtwrupqs\",\"value\":\"nmic\"}],\"activeRevisionsMode\":\"Multiple\",\"ingress\":{\"fqdn\":\"o\",\"external\":false,\"targetPort\":2060505199,\"exposedPort\":1344905503,\"transport\":\"tcp\",\"traffic\":[{\"revisionName\":\"fcnj\",\"weight\":534363981,\"latestRevision\":false,\"label\":\"hbttkphyw\"}],\"customDomains\":[{\"name\":\"jtoqne\",\"bindingType\":\"Disabled\",\"certificateId\":\"lfplp\"},{\"name\":\"oxuscrpabgyepsbj\",\"bindingType\":\"Disabled\",\"certificateId\":\"qugxywpmueefjzwf\"},{\"name\":\"kqujidsuyono\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"aocqxtccmgy\"},{\"name\":\"dxyt\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"yrxvwfudwpznt\"}],\"allowInsecure\":false,\"ipSecurityRestrictions\":[{\"name\":\"lrqjbhckfr\",\"description\":\"rxsbkyvp\",\"ipAddressRange\":\"ca\",\"action\":\"Deny\"}]},\"registries\":[{\"server\":\"zka\",\"username\":\"uwbc\",\"passwordSecretRef\":\"wbme\",\"identity\":\"seyvj\"},{\"server\":\"rts\",\"username\":\"spkdee\",\"passwordSecretRef\":\"ofmxagkvtmelmqkr\",\"identity\":\"hvljuahaquh\"},{\"server\":\"hmdua\",\"username\":\"exq\",\"passwordSecretRef\":\"fadmws\",\"identity\":\"r\"}],\"dapr\":{\"enabled\":false,\"appId\":\"gomz\",\"appProtocol\":\"http\",\"appPort\":491284864,\"httpReadBufferSize\":838222488,\"httpMaxRequestSize\":1787960878,\"logLevel\":\"error\",\"enableApiLogging\":true},\"maxInactiveRevisions\":941784903}") - .toObject(Configuration.class); - Assertions.assertEquals("kn", model.secrets().get(0).name()); - Assertions.assertEquals("scwsv", model.secrets().get(0).value()); - Assertions.assertEquals(ActiveRevisionsMode.MULTIPLE, model.activeRevisionsMode()); - Assertions.assertEquals(false, model.ingress().external()); - Assertions.assertEquals(2060505199, model.ingress().targetPort()); - Assertions.assertEquals(1344905503, model.ingress().exposedPort()); - Assertions.assertEquals(IngressTransportMethod.TCP, model.ingress().transport()); - Assertions.assertEquals("fcnj", model.ingress().traffic().get(0).revisionName()); - Assertions.assertEquals(534363981, model.ingress().traffic().get(0).weight()); - Assertions.assertEquals(false, model.ingress().traffic().get(0).latestRevision()); - Assertions.assertEquals("hbttkphyw", model.ingress().traffic().get(0).label()); - Assertions.assertEquals("jtoqne", model.ingress().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, model.ingress().customDomains().get(0).bindingType()); - Assertions.assertEquals("lfplp", model.ingress().customDomains().get(0).certificateId()); - Assertions.assertEquals(false, model.ingress().allowInsecure()); - Assertions.assertEquals("lrqjbhckfr", model.ingress().ipSecurityRestrictions().get(0).name()); - Assertions.assertEquals("rxsbkyvp", model.ingress().ipSecurityRestrictions().get(0).description()); - Assertions.assertEquals("ca", model.ingress().ipSecurityRestrictions().get(0).ipAddressRange()); - Assertions.assertEquals(Action.DENY, model.ingress().ipSecurityRestrictions().get(0).action()); - Assertions.assertEquals("zka", model.registries().get(0).server()); - Assertions.assertEquals("uwbc", model.registries().get(0).username()); - Assertions.assertEquals("wbme", model.registries().get(0).passwordSecretRef()); - Assertions.assertEquals("seyvj", model.registries().get(0).identity()); - Assertions.assertEquals(false, model.dapr().enabled()); - Assertions.assertEquals("gomz", model.dapr().appId()); - Assertions.assertEquals(AppProtocol.HTTP, model.dapr().appProtocol()); - Assertions.assertEquals(491284864, model.dapr().appPort()); - Assertions.assertEquals(838222488, model.dapr().httpReadBufferSize()); - Assertions.assertEquals(1787960878, model.dapr().httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.ERROR, model.dapr().logLevel()); - Assertions.assertEquals(true, model.dapr().enableApiLogging()); - Assertions.assertEquals(941784903, model.maxInactiveRevisions()); - } - - @Test - public void testSerialize() { - Configuration model = - new Configuration() - .withSecrets( - Arrays - .asList( - new Secret().withName("kn").withValue("scwsv"), - new Secret().withName("otogtwrupqs").withValue("nmic"))) - .withActiveRevisionsMode(ActiveRevisionsMode.MULTIPLE) - .withIngress( - new Ingress() - .withExternal(false) - .withTargetPort(2060505199) - .withExposedPort(1344905503) - .withTransport(IngressTransportMethod.TCP) - .withTraffic( - Arrays - .asList( - new TrafficWeight() - .withRevisionName("fcnj") - .withWeight(534363981) - .withLatestRevision(false) - .withLabel("hbttkphyw"))) - .withCustomDomains( - Arrays - .asList( - new CustomDomain() - .withName("jtoqne") - .withBindingType(BindingType.DISABLED) - .withCertificateId("lfplp"), - new CustomDomain() - .withName("oxuscrpabgyepsbj") - .withBindingType(BindingType.DISABLED) - .withCertificateId("qugxywpmueefjzwf"), - new CustomDomain() - .withName("kqujidsuyono") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("aocqxtccmgy"), - new CustomDomain() - .withName("dxyt") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("yrxvwfudwpznt"))) - .withAllowInsecure(false) - .withIpSecurityRestrictions( - Arrays - .asList( - new IpSecurityRestrictionRule() - .withName("lrqjbhckfr") - .withDescription("rxsbkyvp") - .withIpAddressRange("ca") - .withAction(Action.DENY)))) - .withRegistries( - Arrays - .asList( - new RegistryCredentials() - .withServer("zka") - .withUsername("uwbc") - .withPasswordSecretRef("wbme") - .withIdentity("seyvj"), - new RegistryCredentials() - .withServer("rts") - .withUsername("spkdee") - .withPasswordSecretRef("ofmxagkvtmelmqkr") - .withIdentity("hvljuahaquh"), - new RegistryCredentials() - .withServer("hmdua") - .withUsername("exq") - .withPasswordSecretRef("fadmws") - .withIdentity("r"))) - .withDapr( - new Dapr() - .withEnabled(false) - .withAppId("gomz") - .withAppProtocol(AppProtocol.HTTP) - .withAppPort(491284864) - .withHttpReadBufferSize(838222488) - .withHttpMaxRequestSize(1787960878) - .withLogLevel(LogLevel.ERROR) - .withEnableApiLogging(true)) - .withMaxInactiveRevisions(941784903); - model = BinaryData.fromObject(model).toObject(Configuration.class); - Assertions.assertEquals("kn", model.secrets().get(0).name()); - Assertions.assertEquals("scwsv", model.secrets().get(0).value()); - Assertions.assertEquals(ActiveRevisionsMode.MULTIPLE, model.activeRevisionsMode()); - Assertions.assertEquals(false, model.ingress().external()); - Assertions.assertEquals(2060505199, model.ingress().targetPort()); - Assertions.assertEquals(1344905503, model.ingress().exposedPort()); - Assertions.assertEquals(IngressTransportMethod.TCP, model.ingress().transport()); - Assertions.assertEquals("fcnj", model.ingress().traffic().get(0).revisionName()); - Assertions.assertEquals(534363981, model.ingress().traffic().get(0).weight()); - Assertions.assertEquals(false, model.ingress().traffic().get(0).latestRevision()); - Assertions.assertEquals("hbttkphyw", model.ingress().traffic().get(0).label()); - Assertions.assertEquals("jtoqne", model.ingress().customDomains().get(0).name()); - Assertions.assertEquals(BindingType.DISABLED, model.ingress().customDomains().get(0).bindingType()); - Assertions.assertEquals("lfplp", model.ingress().customDomains().get(0).certificateId()); - Assertions.assertEquals(false, model.ingress().allowInsecure()); - Assertions.assertEquals("lrqjbhckfr", model.ingress().ipSecurityRestrictions().get(0).name()); - Assertions.assertEquals("rxsbkyvp", model.ingress().ipSecurityRestrictions().get(0).description()); - Assertions.assertEquals("ca", model.ingress().ipSecurityRestrictions().get(0).ipAddressRange()); - Assertions.assertEquals(Action.DENY, model.ingress().ipSecurityRestrictions().get(0).action()); - Assertions.assertEquals("zka", model.registries().get(0).server()); - Assertions.assertEquals("uwbc", model.registries().get(0).username()); - Assertions.assertEquals("wbme", model.registries().get(0).passwordSecretRef()); - Assertions.assertEquals("seyvj", model.registries().get(0).identity()); - Assertions.assertEquals(false, model.dapr().enabled()); - Assertions.assertEquals("gomz", model.dapr().appId()); - Assertions.assertEquals(AppProtocol.HTTP, model.dapr().appProtocol()); - Assertions.assertEquals(491284864, model.dapr().appPort()); - Assertions.assertEquals(838222488, model.dapr().httpReadBufferSize()); - Assertions.assertEquals(1787960878, model.dapr().httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.ERROR, model.dapr().logLevel()); - Assertions.assertEquals(true, model.dapr().enableApiLogging()); - Assertions.assertEquals(941784903, model.maxInactiveRevisions()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentCollectionTests.java deleted file mode 100644 index 511f3f22c6083..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentCollectionTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentInner; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentCollection; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ConnectedEnvironmentCollectionTests { - @Test - public void testDeserialize() { - ConnectedEnvironmentCollection model = - BinaryData - .fromString( - "{\"value\":[{\"extendedLocation\":{\"name\":\"rtujwsawddjibab\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"InfrastructureSetupComplete\",\"deploymentErrors\":\"tzeexav\",\"defaultDomain\":\"tfgle\",\"staticIp\":\"m\",\"daprAIConnectionString\":\"bwpypqtgsfjacb\"},\"location\":\"hxudbxvodht\",\"tags\":{\"agzrcxfa\":\"rudhzmmesckdl\",\"xwmdboxd\":\"lc\"},\"id\":\"gsftufqobrjlnacg\",\"name\":\"ckknhxkizvy\",\"type\":\"nrzvuljraaer\"},{\"extendedLocation\":{\"name\":\"kqg\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"InitializationInProgress\",\"deploymentErrors\":\"broyla\",\"defaultDomain\":\"ulcdisdosf\",\"staticIp\":\"jsvg\",\"daprAIConnectionString\":\"whryvycytdcl\"},\"location\":\"cknfnwmbtmvpd\",\"tags\":{\"efedxihchrphkm\":\"httz\",\"gtgkylkdghr\":\"rjdqnsdfzp\",\"kvbwnhhtqlgeh\":\"euutlwxezwzh\",\"vgcxtx\":\"ppipifhpfeoa\"},\"id\":\"csheafidltugsr\",\"name\":\"smkss\",\"type\":\"h\"},{\"extendedLocation\":{\"name\":\"txfkfweg\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"Failed\",\"deploymentErrors\":\"lucbiqtgdqohm\",\"defaultDomain\":\"sldrizetpwbral\",\"staticIp\":\"ibph\",\"daprAIConnectionString\":\"zmizakakan\"},\"location\":\"dnjzh\",\"tags\":{\"oyxprimr\":\"ylhjlm\",\"eislstvasylwx\":\"opteecj\",\"eoohguufuzboyj\":\"zaum\",\"a\":\"thwtzol\"},\"id\":\"mwmdxmebwjscjpa\",\"name\":\"lxveabfqx\",\"type\":\"mwmqtibx\"}],\"nextLink\":\"jddtvqct\"}") - .toObject(ConnectedEnvironmentCollection.class); - Assertions.assertEquals("hxudbxvodht", model.value().get(0).location()); - Assertions.assertEquals("rudhzmmesckdl", model.value().get(0).tags().get("agzrcxfa")); - Assertions.assertEquals("rtujwsawddjibab", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("m", model.value().get(0).staticIp()); - Assertions.assertEquals("bwpypqtgsfjacb", model.value().get(0).daprAIConnectionString()); - } - - @Test - public void testSerialize() { - ConnectedEnvironmentCollection model = - new ConnectedEnvironmentCollection() - .withValue( - Arrays - .asList( - new ConnectedEnvironmentInner() - .withLocation("hxudbxvodht") - .withTags(mapOf("agzrcxfa", "rudhzmmesckdl", "xwmdboxd", "lc")) - .withExtendedLocation( - new ExtendedLocation() - .withName("rtujwsawddjibab") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withStaticIp("m") - .withDaprAIConnectionString("bwpypqtgsfjacb"), - new ConnectedEnvironmentInner() - .withLocation("cknfnwmbtmvpd") - .withTags( - mapOf( - "efedxihchrphkm", - "httz", - "gtgkylkdghr", - "rjdqnsdfzp", - "kvbwnhhtqlgeh", - "euutlwxezwzh", - "vgcxtx", - "ppipifhpfeoa")) - .withExtendedLocation( - new ExtendedLocation() - .withName("kqg") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withStaticIp("jsvg") - .withDaprAIConnectionString("whryvycytdcl"), - new ConnectedEnvironmentInner() - .withLocation("dnjzh") - .withTags( - mapOf( - "oyxprimr", - "ylhjlm", - "eislstvasylwx", - "opteecj", - "eoohguufuzboyj", - "zaum", - "a", - "thwtzol")) - .withExtendedLocation( - new ExtendedLocation() - .withName("txfkfweg") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withStaticIp("ibph") - .withDaprAIConnectionString("zmizakakan"))); - model = BinaryData.fromObject(model).toObject(ConnectedEnvironmentCollection.class); - Assertions.assertEquals("hxudbxvodht", model.value().get(0).location()); - Assertions.assertEquals("rudhzmmesckdl", model.value().get(0).tags().get("agzrcxfa")); - Assertions.assertEquals("rtujwsawddjibab", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("m", model.value().get(0).staticIp()); - Assertions.assertEquals("bwpypqtgsfjacb", model.value().get(0).daprAIConnectionString()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentInnerTests.java deleted file mode 100644 index 7c98ab3255959..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentInnerTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentInner; -import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ConnectedEnvironmentInnerTests { - @Test - public void testDeserialize() { - ConnectedEnvironmentInner model = - BinaryData - .fromString( - "{\"extendedLocation\":{\"name\":\"ijaeukm\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"Failed\",\"deploymentErrors\":\"ndzaapmudq\",\"defaultDomain\":\"qwigpibudqwyxe\",\"staticIp\":\"ybpmzznrtffyaq\",\"daprAIConnectionString\":\"mhh\",\"customDomainConfiguration\":{\"customDomainVerificationId\":\"qaqhvseufu\",\"dnsSuffix\":\"rxpdlcgqlsi\",\"expirationDate\":\"2021-05-24T18:35:38Z\",\"thumbprint\":\"ddgamquhiosr\",\"subjectName\":\"uivfcdis\"}},\"location\":\"rnxzh\",\"tags\":{\"qvwre\":\"xrxzbujrtr\",\"nzonzl\":\"khgn\",\"jtszcof\":\"piqywnc\",\"k\":\"zehtdhgb\"},\"id\":\"reljeamur\",\"name\":\"zmlovuanash\",\"type\":\"xlpm\"}") - .toObject(ConnectedEnvironmentInner.class); - Assertions.assertEquals("rnxzh", model.location()); - Assertions.assertEquals("xrxzbujrtr", model.tags().get("qvwre")); - Assertions.assertEquals("ijaeukm", model.extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.extendedLocation().type()); - Assertions.assertEquals("ybpmzznrtffyaq", model.staticIp()); - Assertions.assertEquals("mhh", model.daprAIConnectionString()); - Assertions.assertEquals("rxpdlcgqlsi", model.customDomainConfiguration().dnsSuffix()); - } - - @Test - public void testSerialize() { - ConnectedEnvironmentInner model = - new ConnectedEnvironmentInner() - .withLocation("rnxzh") - .withTags(mapOf("qvwre", "xrxzbujrtr", "nzonzl", "khgn", "jtszcof", "piqywnc", "k", "zehtdhgb")) - .withExtendedLocation( - new ExtendedLocation().withName("ijaeukm").withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withStaticIp("ybpmzznrtffyaq") - .withDaprAIConnectionString("mhh") - .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("rxpdlcgqlsi")); - model = BinaryData.fromObject(model).toObject(ConnectedEnvironmentInner.class); - Assertions.assertEquals("rnxzh", model.location()); - Assertions.assertEquals("xrxzbujrtr", model.tags().get("qvwre")); - Assertions.assertEquals("ijaeukm", model.extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.extendedLocation().type()); - Assertions.assertEquals("ybpmzznrtffyaq", model.staticIp()); - Assertions.assertEquals("mhh", model.daprAIConnectionString()); - Assertions.assertEquals("rxpdlcgqlsi", model.customDomainConfiguration().dnsSuffix()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPropertiesTests.java deleted file mode 100644 index 1dcf7976eed2d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentProperties; -import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ConnectedEnvironmentPropertiesTests { - @Test - public void testDeserialize() { - ConnectedEnvironmentProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"InfrastructureSetupInProgress\",\"deploymentErrors\":\"dk\",\"defaultDomain\":\"vidizozsdb\",\"staticIp\":\"xjmonf\",\"daprAIConnectionString\":\"nwncypuuw\",\"customDomainConfiguration\":{\"customDomainVerificationId\":\"v\",\"dnsSuffix\":\"jctzenkei\",\"expirationDate\":\"2021-11-19T10:45:07Z\",\"thumbprint\":\"dasvfl\",\"subjectName\":\"bxcudchx\"}}") - .toObject(ConnectedEnvironmentProperties.class); - Assertions.assertEquals("xjmonf", model.staticIp()); - Assertions.assertEquals("nwncypuuw", model.daprAIConnectionString()); - Assertions.assertEquals("jctzenkei", model.customDomainConfiguration().dnsSuffix()); - } - - @Test - public void testSerialize() { - ConnectedEnvironmentProperties model = - new ConnectedEnvironmentProperties() - .withStaticIp("xjmonf") - .withDaprAIConnectionString("nwncypuuw") - .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("jctzenkei")); - model = BinaryData.fromObject(model).toObject(ConnectedEnvironmentProperties.class); - Assertions.assertEquals("xjmonf", model.staticIp()); - Assertions.assertEquals("nwncypuuw", model.daprAIConnectionString()); - Assertions.assertEquals("jctzenkei", model.customDomainConfiguration().dnsSuffix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentStoragesCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentStoragesCollectionInnerTests.java deleted file mode 100644 index 77b5f9f5f58d8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentStoragesCollectionInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentStorageInner; -import com.azure.resourcemanager.appcontainers.fluent.models.ConnectedEnvironmentStoragesCollectionInner; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironmentStorageProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class ConnectedEnvironmentStoragesCollectionInnerTests { - @Test - public void testDeserialize() { - ConnectedEnvironmentStoragesCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"ldforobwj\",\"name\":\"vizbfhfo\",\"type\":\"vacqpbtuodxesz\"},{\"properties\":{},\"id\":\"l\",\"name\":\"wumuaslzk\",\"type\":\"rrwoycqucwyhahn\"},{\"properties\":{},\"id\":\"kywuhpsvfuu\",\"name\":\"utlwexxwla\",\"type\":\"niexzsrzpgepq\"}]}") - .toObject(ConnectedEnvironmentStoragesCollectionInner.class); - } - - @Test - public void testSerialize() { - ConnectedEnvironmentStoragesCollectionInner model = - new ConnectedEnvironmentStoragesCollectionInner() - .withValue( - Arrays - .asList( - new ConnectedEnvironmentStorageInner() - .withProperties(new ConnectedEnvironmentStorageProperties()), - new ConnectedEnvironmentStorageInner() - .withProperties(new ConnectedEnvironmentStorageProperties()), - new ConnectedEnvironmentStorageInner() - .withProperties(new ConnectedEnvironmentStorageProperties()))); - model = BinaryData.fromObject(model).toObject(ConnectedEnvironmentStoragesCollectionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateMockTests.java deleted file mode 100644 index 1ae6489b0f96b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironment; -import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"extendedLocation\":{\"name\":\"suckzm\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"deploymentErrors\":\"xaxmq\",\"defaultDomain\":\"alhhjnhgwydyynfs\",\"staticIp\":\"hgbvqtan\",\"daprAIConnectionString\":\"fdlpukhpyr\",\"customDomainConfiguration\":{\"customDomainVerificationId\":\"zjcpeogk\",\"dnsSuffix\":\"mgbro\",\"expirationDate\":\"2021-08-20T12:22:55Z\",\"thumbprint\":\"fhp\",\"subjectName\":\"azjzo\"}},\"location\":\"jxhpdulontacn\",\"tags\":{\"xh\":\"tehtuevrhrljyoog\"},\"id\":\"sd\",\"name\":\"ugwbsreurfqkf\",\"type\":\"arenlvhhtklnvnaf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectedEnvironment response = - manager - .connectedEnvironments() - .define("usqogsfikayia") - .withRegion("chrszi") - .withExistingResourceGroup("ijtk") - .withTags(mapOf("fqyggagflnlgmtr", "uelyetndn")) - .withExtendedLocation( - new ExtendedLocation().withName("arujt").withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withStaticIp("bqeqqekewvnqvcd") - .withDaprAIConnectionString("uaucmf") - .withCustomDomainConfiguration(new CustomDomainConfiguration().withDnsSuffix("itacgxmfcsserx")) - .create(); - - Assertions.assertEquals("jxhpdulontacn", response.location()); - Assertions.assertEquals("tehtuevrhrljyoog", response.tags().get("xh")); - Assertions.assertEquals("suckzm", response.extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, response.extendedLocation().type()); - Assertions.assertEquals("hgbvqtan", response.staticIp()); - Assertions.assertEquals("fdlpukhpyr", response.daprAIConnectionString()); - Assertions.assertEquals("mgbro", response.customDomainConfiguration().dnsSuffix()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListMockTests.java deleted file mode 100644 index 352da9aeea5da..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDaprComponentsListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.DaprComponent; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsDaprComponentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"componentType\":\"rymo\",\"version\":\"zrxklobd\",\"ignoreErrors\":true,\"initTimeout\":\"pmkmlmvevfx\",\"secrets\":[],\"secretStoreComponent\":\"hbzxli\",\"metadata\":[],\"scopes\":[\"dtfgxqbawpcbb\"]},\"id\":\"qcy\",\"name\":\"napqo\",\"type\":\"yuicdhzbdy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.connectedEnvironmentsDaprComponents().list("vroevytlyo", "rrrouuxvnsa", Context.NONE); - - Assertions.assertEquals("rymo", response.iterator().next().componentType()); - Assertions.assertEquals("zrxklobd", response.iterator().next().version()); - Assertions.assertEquals(true, response.iterator().next().ignoreErrors()); - Assertions.assertEquals("pmkmlmvevfx", response.iterator().next().initTimeout()); - Assertions.assertEquals("hbzxli", response.iterator().next().secretStoreComponent()); - Assertions.assertEquals("dtfgxqbawpcbb", response.iterator().next().scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteMockTests.java deleted file mode 100644 index 9d10d4deec7c8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectedEnvironments().delete("djk", "sysidfvclglxnf", Context.NONE); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupMockTests.java deleted file mode 100644 index b4ae858aa596d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListByResourceGroupMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironment; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"extendedLocation\":{\"name\":\"pusxjb\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"Failed\",\"deploymentErrors\":\"ohzjqatucoigeb\",\"defaultDomain\":\"cnwfepbnwgfmxjg\",\"staticIp\":\"bjb\",\"daprAIConnectionString\":\"lfgtdysnaquflqbc\",\"customDomainConfiguration\":{\"customDomainVerificationId\":\"amz\",\"dnsSuffix\":\"wdkqzeqy\",\"expirationDate\":\"2021-03-27T03:11:25Z\",\"thumbprint\":\"njxdfzantk\",\"subjectName\":\"eg\"}},\"location\":\"mlbnseq\",\"tags\":{\"m\":\"jvpilguooqja\",\"hrtdtpdelq\":\"itgueiookjbs\",\"vcjkgd\":\"cslmotoebnfxo\",\"vcopex\":\"razftxejwabmdujt\"},\"id\":\"m\",\"name\":\"urbuhhlkyqltq\",\"type\":\"rogtuwkf\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.connectedEnvironments().listByResourceGroup("cbuewmrswnjlxuz", Context.NONE); - - Assertions.assertEquals("mlbnseq", response.iterator().next().location()); - Assertions.assertEquals("jvpilguooqja", response.iterator().next().tags().get("m")); - Assertions.assertEquals("pusxjb", response.iterator().next().extendedLocation().name()); - Assertions - .assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("bjb", response.iterator().next().staticIp()); - Assertions.assertEquals("lfgtdysnaquflqbc", response.iterator().next().daprAIConnectionString()); - Assertions.assertEquals("wdkqzeqy", response.iterator().next().customDomainConfiguration().dnsSuffix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListMockTests.java deleted file mode 100644 index 9b849fecf3486..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ConnectedEnvironmentsListMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ConnectedEnvironment; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectedEnvironmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"extendedLocation\":{\"name\":\"wpnulaiywzejyw\",\"type\":\"CustomLocation\"},\"properties\":{\"provisioningState\":\"ScheduledForDelete\",\"deploymentErrors\":\"pllndnp\",\"defaultDomain\":\"rpqaf\",\"staticIp\":\"ug\",\"daprAIConnectionString\":\"n\",\"customDomainConfiguration\":{\"customDomainVerificationId\":\"et\",\"dnsSuffix\":\"ypococtfjgtixr\",\"expirationDate\":\"2021-06-13T22:05:20Z\",\"thumbprint\":\"urmlmuo\",\"subjectName\":\"lbau\"}},\"location\":\"opionszon\",\"tags\":{\"jmyccxlzhcoxov\":\"gajinnixjawrtmj\",\"sfnrdtjxt\":\"ekhenl\",\"cq\":\"r\",\"uslvyjtcvuwkasi\":\"jvidttge\"},\"id\":\"iesfuug\",\"name\":\"tuqfecjxeygtu\",\"type\":\"xu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.connectedEnvironments().list(Context.NONE); - - Assertions.assertEquals("opionszon", response.iterator().next().location()); - Assertions.assertEquals("gajinnixjawrtmj", response.iterator().next().tags().get("jmyccxlzhcoxov")); - Assertions.assertEquals("wpnulaiywzejyw", response.iterator().next().extendedLocation().name()); - Assertions - .assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("ug", response.iterator().next().staticIp()); - Assertions.assertEquals("n", response.iterator().next().daprAIConnectionString()); - Assertions.assertEquals("ypococtfjgtixr", response.iterator().next().customDomainConfiguration().dnsSuffix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppCollectionTests.java deleted file mode 100644 index 57d5fded64387..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppCollectionTests.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; -import com.azure.resourcemanager.appcontainers.models.ContainerAppCollection; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppCollectionTests { - @Test - public void testDeserialize() { - ContainerAppCollection model = - BinaryData - .fromString( - "{\"value\":[{\"extendedLocation\":{\"name\":\"ybcibvyvdcsit\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Canceled\",\"managedEnvironmentId\":\"f\",\"environmentId\":\"scjeypv\",\"workloadProfileType\":\"zrkgqhcjrefovg\",\"latestRevisionName\":\"qsl\",\"latestRevisionFqdn\":\"yvxyqjp\",\"customDomainVerificationId\":\"attpngjcrcczsq\",\"outboundIpAddresses\":[],\"eventStreamEndpoint\":\"daj\"},\"location\":\"ysou\",\"tags\":{\"yhltrpmopjmcm\":\"canoaeupf\"},\"id\":\"tuo\",\"name\":\"thfuiuaodsfcpkvx\",\"type\":\"dpuozmyz\"},{\"extendedLocation\":{\"name\":\"gf\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Deleting\",\"managedEnvironmentId\":\"twhrdxwzywqsm\",\"environmentId\":\"ureximoryocfs\",\"workloadProfileType\":\"s\",\"latestRevisionName\":\"ddystkiiuxhqy\",\"latestRevisionFqdn\":\"xorrqnb\",\"customDomainVerificationId\":\"czvyifq\",\"outboundIpAddresses\":[],\"eventStreamEndpoint\":\"jsllrmv\"},\"location\":\"f\",\"tags\":{\"wiqzbqjvsovmyo\":\"kpnpulexxbczwtr\"},\"id\":\"acspkwl\",\"name\":\"zdobpxjmflbvvnch\",\"type\":\"kcciwwzjuqkhr\"},{\"extendedLocation\":{\"name\":\"iwkuofos\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"InProgress\",\"managedEnvironmentId\":\"xieduugidyjrr\",\"environmentId\":\"y\",\"workloadProfileType\":\"svexcsonpclhoco\",\"latestRevisionName\":\"lkevle\",\"latestRevisionFqdn\":\"zfbuhf\",\"customDomainVerificationId\":\"faxkffeii\",\"outboundIpAddresses\":[],\"eventStreamEndpoint\":\"ez\"},\"location\":\"shxmzsbbzoggigrx\",\"tags\":{\"jnspydp\":\"rvjx\"},\"id\":\"koen\",\"name\":\"ou\",\"type\":\"nvudwtiukb\"}],\"nextLink\":\"ngkpocipazy\"}") - .toObject(ContainerAppCollection.class); - Assertions.assertEquals("ysou", model.value().get(0).location()); - Assertions.assertEquals("canoaeupf", model.value().get(0).tags().get("yhltrpmopjmcm")); - Assertions.assertEquals("ybcibvyvdcsit", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("f", model.value().get(0).managedEnvironmentId()); - Assertions.assertEquals("scjeypv", model.value().get(0).environmentId()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).workloadProfileType()); - } - - @Test - public void testSerialize() { - ContainerAppCollection model = - new ContainerAppCollection() - .withValue( - Arrays - .asList( - new ContainerAppInner() - .withLocation("ysou") - .withTags(mapOf("yhltrpmopjmcm", "canoaeupf")) - .withExtendedLocation( - new ExtendedLocation() - .withName("ybcibvyvdcsit") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withManagedEnvironmentId("f") - .withEnvironmentId("scjeypv") - .withWorkloadProfileType("zrkgqhcjrefovg"), - new ContainerAppInner() - .withLocation("f") - .withTags(mapOf("wiqzbqjvsovmyo", "kpnpulexxbczwtr")) - .withExtendedLocation( - new ExtendedLocation() - .withName("gf") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withManagedEnvironmentId("twhrdxwzywqsm") - .withEnvironmentId("ureximoryocfs") - .withWorkloadProfileType("s"), - new ContainerAppInner() - .withLocation("shxmzsbbzoggigrx") - .withTags(mapOf("jnspydp", "rvjx")) - .withExtendedLocation( - new ExtendedLocation() - .withName("iwkuofos") - .withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf())) - .withManagedEnvironmentId("xieduugidyjrr") - .withEnvironmentId("y") - .withWorkloadProfileType("svexcsonpclhoco"))); - model = BinaryData.fromObject(model).toObject(ContainerAppCollection.class); - Assertions.assertEquals("ysou", model.value().get(0).location()); - Assertions.assertEquals("canoaeupf", model.value().get(0).tags().get("yhltrpmopjmcm")); - Assertions.assertEquals("ybcibvyvdcsit", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.value().get(0).extendedLocation().type()); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("f", model.value().get(0).managedEnvironmentId()); - Assertions.assertEquals("scjeypv", model.value().get(0).environmentId()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).workloadProfileType()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppInnerTests.java deleted file mode 100644 index 09fb61485df13..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppInnerTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner; -import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; -import com.azure.resourcemanager.appcontainers.models.Configuration; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.appcontainers.models.Template; -import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppInnerTests { - @Test - public void testDeserialize() { - ContainerAppInner model = - BinaryData - .fromString( - "{\"extendedLocation\":{\"name\":\"gukgjnpiucgygevq\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"c\":{}}},\"properties\":{\"provisioningState\":\"Failed\",\"managedEnvironmentId\":\"dpydn\",\"environmentId\":\"hxdeoejz\",\"workloadProfileType\":\"w\",\"latestRevisionName\":\"sjttgzfbish\",\"latestRevisionFqdn\":\"khaj\",\"customDomainVerificationId\":\"yeamdphagalpb\",\"configuration\":{\"secrets\":[],\"activeRevisionsMode\":\"Single\",\"registries\":[],\"maxInactiveRevisions\":1833977837},\"template\":{\"revisionSuffix\":\"shwankixzbinje\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"outboundIpAddresses\":[\"zoqftiyqzrnkcqvy\",\"lwh\"],\"eventStreamEndpoint\":\"sicohoqqnwvlry\"},\"location\":\"w\",\"tags\":{\"gyxzk\":\"unmmq\"},\"id\":\"noc\",\"name\":\"koklya\",\"type\":\"uconuqszfkbey\"}") - .toObject(ContainerAppInner.class); - Assertions.assertEquals("w", model.location()); - Assertions.assertEquals("unmmq", model.tags().get("gyxzk")); - Assertions.assertEquals("gukgjnpiucgygevq", model.extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.extendedLocation().type()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("dpydn", model.managedEnvironmentId()); - Assertions.assertEquals("hxdeoejz", model.environmentId()); - Assertions.assertEquals("w", model.workloadProfileType()); - Assertions.assertEquals(ActiveRevisionsMode.SINGLE, model.configuration().activeRevisionsMode()); - Assertions.assertEquals(1833977837, model.configuration().maxInactiveRevisions()); - Assertions.assertEquals("shwankixzbinje", model.template().revisionSuffix()); - } - - @Test - public void testSerialize() { - ContainerAppInner model = - new ContainerAppInner() - .withLocation("w") - .withTags(mapOf("gyxzk", "unmmq")) - .withExtendedLocation( - new ExtendedLocation().withName("gukgjnpiucgygevq").withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("c", new UserAssignedIdentity()))) - .withManagedEnvironmentId("dpydn") - .withEnvironmentId("hxdeoejz") - .withWorkloadProfileType("w") - .withConfiguration( - new Configuration() - .withSecrets(Arrays.asList()) - .withActiveRevisionsMode(ActiveRevisionsMode.SINGLE) - .withRegistries(Arrays.asList()) - .withMaxInactiveRevisions(1833977837)) - .withTemplate( - new Template() - .withRevisionSuffix("shwankixzbinje") - .withInitContainers(Arrays.asList()) - .withContainers(Arrays.asList()) - .withVolumes(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(ContainerAppInner.class); - Assertions.assertEquals("w", model.location()); - Assertions.assertEquals("unmmq", model.tags().get("gyxzk")); - Assertions.assertEquals("gukgjnpiucgygevq", model.extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.extendedLocation().type()); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("dpydn", model.managedEnvironmentId()); - Assertions.assertEquals("hxdeoejz", model.environmentId()); - Assertions.assertEquals("w", model.workloadProfileType()); - Assertions.assertEquals(ActiveRevisionsMode.SINGLE, model.configuration().activeRevisionsMode()); - Assertions.assertEquals(1833977837, model.configuration().maxInactiveRevisions()); - Assertions.assertEquals("shwankixzbinje", model.template().revisionSuffix()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetHttpHeadersItemTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetHttpHeadersItemTests.java deleted file mode 100644 index 7a49f669c8f2c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetHttpHeadersItemTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppProbeHttpGetHttpHeadersItemTests { - @Test - public void testDeserialize() { - ContainerAppProbeHttpGetHttpHeadersItem model = - BinaryData - .fromString("{\"name\":\"fcktqumiekke\",\"value\":\"zikhl\"}") - .toObject(ContainerAppProbeHttpGetHttpHeadersItem.class); - Assertions.assertEquals("fcktqumiekke", model.name()); - Assertions.assertEquals("zikhl", model.value()); - } - - @Test - public void testSerialize() { - ContainerAppProbeHttpGetHttpHeadersItem model = - new ContainerAppProbeHttpGetHttpHeadersItem().withName("fcktqumiekke").withValue("zikhl"); - model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGetHttpHeadersItem.class); - Assertions.assertEquals("fcktqumiekke", model.name()); - Assertions.assertEquals("zikhl", model.value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetTests.java deleted file mode 100644 index e24fca86a780c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeHttpGetTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.Scheme; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppProbeHttpGetTests { - @Test - public void testDeserialize() { - ContainerAppProbeHttpGet model = - BinaryData - .fromString( - "{\"host\":\"jawneaiv\",\"httpHeaders\":[{\"name\":\"zel\",\"value\":\"c\"},{\"name\":\"r\",\"value\":\"lsfeaenwabfatkld\"},{\"name\":\"xbjhwuaanozjosph\",\"value\":\"oulpjrv\"}],\"path\":\"glrvimjwosytxi\",\"port\":1413257471,\"scheme\":\"HTTP\"}") - .toObject(ContainerAppProbeHttpGet.class); - Assertions.assertEquals("jawneaiv", model.host()); - Assertions.assertEquals("zel", model.httpHeaders().get(0).name()); - Assertions.assertEquals("c", model.httpHeaders().get(0).value()); - Assertions.assertEquals("glrvimjwosytxi", model.path()); - Assertions.assertEquals(1413257471, model.port()); - Assertions.assertEquals(Scheme.HTTP, model.scheme()); - } - - @Test - public void testSerialize() { - ContainerAppProbeHttpGet model = - new ContainerAppProbeHttpGet() - .withHost("jawneaiv") - .withHttpHeaders( - Arrays - .asList( - new ContainerAppProbeHttpGetHttpHeadersItem().withName("zel").withValue("c"), - new ContainerAppProbeHttpGetHttpHeadersItem().withName("r").withValue("lsfeaenwabfatkld"), - new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("xbjhwuaanozjosph") - .withValue("oulpjrv"))) - .withPath("glrvimjwosytxi") - .withPort(1413257471) - .withScheme(Scheme.HTTP); - model = BinaryData.fromObject(model).toObject(ContainerAppProbeHttpGet.class); - Assertions.assertEquals("jawneaiv", model.host()); - Assertions.assertEquals("zel", model.httpHeaders().get(0).name()); - Assertions.assertEquals("c", model.httpHeaders().get(0).value()); - Assertions.assertEquals("glrvimjwosytxi", model.path()); - Assertions.assertEquals(1413257471, model.port()); - Assertions.assertEquals(Scheme.HTTP, model.scheme()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTcpSocketTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTcpSocketTests.java deleted file mode 100644 index e4903494ed139..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTcpSocketTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppProbeTcpSocketTests { - @Test - public void testDeserialize() { - ContainerAppProbeTcpSocket model = - BinaryData - .fromString("{\"host\":\"jhdgqggebdunyga\",\"port\":2021053825}") - .toObject(ContainerAppProbeTcpSocket.class); - Assertions.assertEquals("jhdgqggebdunyga", model.host()); - Assertions.assertEquals(2021053825, model.port()); - } - - @Test - public void testSerialize() { - ContainerAppProbeTcpSocket model = - new ContainerAppProbeTcpSocket().withHost("jhdgqggebdunyga").withPort(2021053825); - model = BinaryData.fromObject(model).toObject(ContainerAppProbeTcpSocket.class); - Assertions.assertEquals("jhdgqggebdunyga", model.host()); - Assertions.assertEquals(2021053825, model.port()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTests.java deleted file mode 100644 index 9ff7131fd14de..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppProbeTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGetHttpHeadersItem; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; -import com.azure.resourcemanager.appcontainers.models.Scheme; -import com.azure.resourcemanager.appcontainers.models.Type; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppProbeTests { - @Test - public void testDeserialize() { - ContainerAppProbe model = - BinaryData - .fromString( - "{\"failureThreshold\":1892001157,\"httpGet\":{\"host\":\"rhyrnxxmueed\",\"httpHeaders\":[{\"name\":\"dvstkw\",\"value\":\"qtc\"},{\"name\":\"ealmfmtdaaygdvwv\",\"value\":\"piohgwxrtfu\"},{\"name\":\"xepxgyqagvrvmn\",\"value\":\"k\"}],\"path\":\"ghimdblx\",\"port\":505358997,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":1046627826,\"periodSeconds\":984160598,\"successThreshold\":44093722,\"tcpSocket\":{\"host\":\"mszkkfo\",\"port\":739435613},\"terminationGracePeriodSeconds\":6713909564686368420,\"timeoutSeconds\":520152641,\"type\":\"Readiness\"}") - .toObject(ContainerAppProbe.class); - Assertions.assertEquals(1892001157, model.failureThreshold()); - Assertions.assertEquals("rhyrnxxmueed", model.httpGet().host()); - Assertions.assertEquals("dvstkw", model.httpGet().httpHeaders().get(0).name()); - Assertions.assertEquals("qtc", model.httpGet().httpHeaders().get(0).value()); - Assertions.assertEquals("ghimdblx", model.httpGet().path()); - Assertions.assertEquals(505358997, model.httpGet().port()); - Assertions.assertEquals(Scheme.HTTP, model.httpGet().scheme()); - Assertions.assertEquals(1046627826, model.initialDelaySeconds()); - Assertions.assertEquals(984160598, model.periodSeconds()); - Assertions.assertEquals(44093722, model.successThreshold()); - Assertions.assertEquals("mszkkfo", model.tcpSocket().host()); - Assertions.assertEquals(739435613, model.tcpSocket().port()); - Assertions.assertEquals(6713909564686368420L, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(520152641, model.timeoutSeconds()); - Assertions.assertEquals(Type.READINESS, model.type()); - } - - @Test - public void testSerialize() { - ContainerAppProbe model = - new ContainerAppProbe() - .withFailureThreshold(1892001157) - .withHttpGet( - new ContainerAppProbeHttpGet() - .withHost("rhyrnxxmueed") - .withHttpHeaders( - Arrays - .asList( - new ContainerAppProbeHttpGetHttpHeadersItem().withName("dvstkw").withValue("qtc"), - new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("ealmfmtdaaygdvwv") - .withValue("piohgwxrtfu"), - new ContainerAppProbeHttpGetHttpHeadersItem() - .withName("xepxgyqagvrvmn") - .withValue("k"))) - .withPath("ghimdblx") - .withPort(505358997) - .withScheme(Scheme.HTTP)) - .withInitialDelaySeconds(1046627826) - .withPeriodSeconds(984160598) - .withSuccessThreshold(44093722) - .withTcpSocket(new ContainerAppProbeTcpSocket().withHost("mszkkfo").withPort(739435613)) - .withTerminationGracePeriodSeconds(6713909564686368420L) - .withTimeoutSeconds(520152641) - .withType(Type.READINESS); - model = BinaryData.fromObject(model).toObject(ContainerAppProbe.class); - Assertions.assertEquals(1892001157, model.failureThreshold()); - Assertions.assertEquals("rhyrnxxmueed", model.httpGet().host()); - Assertions.assertEquals("dvstkw", model.httpGet().httpHeaders().get(0).name()); - Assertions.assertEquals("qtc", model.httpGet().httpHeaders().get(0).value()); - Assertions.assertEquals("ghimdblx", model.httpGet().path()); - Assertions.assertEquals(505358997, model.httpGet().port()); - Assertions.assertEquals(Scheme.HTTP, model.httpGet().scheme()); - Assertions.assertEquals(1046627826, model.initialDelaySeconds()); - Assertions.assertEquals(984160598, model.periodSeconds()); - Assertions.assertEquals(44093722, model.successThreshold()); - Assertions.assertEquals("mszkkfo", model.tcpSocket().host()); - Assertions.assertEquals(739435613, model.tcpSocket().port()); - Assertions.assertEquals(6713909564686368420L, model.terminationGracePeriodSeconds()); - Assertions.assertEquals(520152641, model.timeoutSeconds()); - Assertions.assertEquals(Type.READINESS, model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPropertiesTests.java deleted file mode 100644 index 5547a7f4e8e69..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppPropertiesTests.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppProperties; -import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; -import com.azure.resourcemanager.appcontainers.models.AppProtocol; -import com.azure.resourcemanager.appcontainers.models.Configuration; -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.Dapr; -import com.azure.resourcemanager.appcontainers.models.Ingress; -import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.LogLevel; -import com.azure.resourcemanager.appcontainers.models.RegistryCredentials; -import com.azure.resourcemanager.appcontainers.models.Scale; -import com.azure.resourcemanager.appcontainers.models.Secret; -import com.azure.resourcemanager.appcontainers.models.StorageType; -import com.azure.resourcemanager.appcontainers.models.Template; -import com.azure.resourcemanager.appcontainers.models.Volume; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerAppPropertiesTests { - @Test - public void testDeserialize() { - ContainerAppProperties model = - BinaryData - .fromString( - "{\"provisioningState\":\"Failed\",\"managedEnvironmentId\":\"i\",\"environmentId\":\"hxepcyvahfnlj\",\"workloadProfileType\":\"qxj\",\"latestRevisionName\":\"ujqgidok\",\"latestRevisionFqdn\":\"ljyoxgvcltb\",\"customDomainVerificationId\":\"ncghkje\",\"configuration\":{\"secrets\":[{\"name\":\"ijhtxf\",\"value\":\"xbf\"},{\"name\":\"xnehmpvec\",\"value\":\"odebfqkkrbmpu\"},{\"name\":\"riwflzlfb\",\"value\":\"puz\"}],\"activeRevisionsMode\":\"Single\",\"ingress\":{\"fqdn\":\"nqzahmgkbrpyyd\",\"external\":true,\"targetPort\":1877210635,\"exposedPort\":2043148337,\"transport\":\"http\",\"traffic\":[],\"customDomains\":[],\"allowInsecure\":true,\"ipSecurityRestrictions\":[]},\"registries\":[{\"server\":\"n\",\"username\":\"ynhijggme\",\"passwordSecretRef\":\"siarbutrcvpn\",\"identity\":\"zmhjrunmp\"}],\"dapr\":{\"enabled\":true,\"appId\":\"hrbnlankxmyskpbh\",\"appProtocol\":\"grpc\",\"appPort\":2131694851,\"httpReadBufferSize\":2016648328,\"httpMaxRequestSize\":83692384,\"logLevel\":\"info\",\"enableApiLogging\":false},\"maxInactiveRevisions\":1863766018},\"template\":{\"revisionSuffix\":\"lqidyby\",\"initContainers\":[{\"image\":\"clha\",\"name\":\"dbabp\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]}],\"containers\":[{\"probes\":[],\"image\":\"thsu\",\"name\":\"cmnyyazttb\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]},{\"probes\":[],\"image\":\"dckzywbiexz\",\"name\":\"yueaxibxujwb\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]},{\"probes\":[],\"image\":\"yoxa\",\"name\":\"dkzjancuxrh\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]},{\"probes\":[],\"image\":\"iwdjswztsdbpgn\",\"name\":\"txhp\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]}],\"scale\":{\"minReplicas\":262767805,\"maxReplicas\":1638223797,\"rules\":[]},\"volumes\":[{\"name\":\"tcty\",\"storageType\":\"AzureFile\",\"storageName\":\"bbovplwzbhvgyugu\"},{\"name\":\"vmkfssxqu\",\"storageType\":\"AzureFile\",\"storageName\":\"l\"},{\"name\":\"gsxnkjzkdeslpv\",\"storageType\":\"AzureFile\",\"storageName\":\"i\"},{\"name\":\"ghxpkdw\",\"storageType\":\"EmptyDir\",\"storageName\":\"uebbaumnyqup\"}]},\"outboundIpAddresses\":[\"ojnabckhsmtxpsie\",\"tfhvpesapskrdqmh\"],\"eventStreamEndpoint\":\"dhtldwkyz\"}") - .toObject(ContainerAppProperties.class); - Assertions.assertEquals("i", model.managedEnvironmentId()); - Assertions.assertEquals("hxepcyvahfnlj", model.environmentId()); - Assertions.assertEquals("qxj", model.workloadProfileType()); - Assertions.assertEquals("ijhtxf", model.configuration().secrets().get(0).name()); - Assertions.assertEquals("xbf", model.configuration().secrets().get(0).value()); - Assertions.assertEquals(ActiveRevisionsMode.SINGLE, model.configuration().activeRevisionsMode()); - Assertions.assertEquals(true, model.configuration().ingress().external()); - Assertions.assertEquals(1877210635, model.configuration().ingress().targetPort()); - Assertions.assertEquals(2043148337, model.configuration().ingress().exposedPort()); - Assertions.assertEquals(IngressTransportMethod.HTTP, model.configuration().ingress().transport()); - Assertions.assertEquals(true, model.configuration().ingress().allowInsecure()); - Assertions.assertEquals("n", model.configuration().registries().get(0).server()); - Assertions.assertEquals("ynhijggme", model.configuration().registries().get(0).username()); - Assertions.assertEquals("siarbutrcvpn", model.configuration().registries().get(0).passwordSecretRef()); - Assertions.assertEquals("zmhjrunmp", model.configuration().registries().get(0).identity()); - Assertions.assertEquals(true, model.configuration().dapr().enabled()); - Assertions.assertEquals("hrbnlankxmyskpbh", model.configuration().dapr().appId()); - Assertions.assertEquals(AppProtocol.GRPC, model.configuration().dapr().appProtocol()); - Assertions.assertEquals(2131694851, model.configuration().dapr().appPort()); - Assertions.assertEquals(2016648328, model.configuration().dapr().httpReadBufferSize()); - Assertions.assertEquals(83692384, model.configuration().dapr().httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.INFO, model.configuration().dapr().logLevel()); - Assertions.assertEquals(false, model.configuration().dapr().enableApiLogging()); - Assertions.assertEquals(1863766018, model.configuration().maxInactiveRevisions()); - Assertions.assertEquals("lqidyby", model.template().revisionSuffix()); - Assertions.assertEquals("clha", model.template().initContainers().get(0).image()); - Assertions.assertEquals("dbabp", model.template().initContainers().get(0).name()); - Assertions.assertEquals("thsu", model.template().containers().get(0).image()); - Assertions.assertEquals("cmnyyazttb", model.template().containers().get(0).name()); - Assertions.assertEquals(262767805, model.template().scale().minReplicas()); - Assertions.assertEquals(1638223797, model.template().scale().maxReplicas()); - Assertions.assertEquals("tcty", model.template().volumes().get(0).name()); - Assertions.assertEquals(StorageType.AZURE_FILE, model.template().volumes().get(0).storageType()); - Assertions.assertEquals("bbovplwzbhvgyugu", model.template().volumes().get(0).storageName()); - } - - @Test - public void testSerialize() { - ContainerAppProperties model = - new ContainerAppProperties() - .withManagedEnvironmentId("i") - .withEnvironmentId("hxepcyvahfnlj") - .withWorkloadProfileType("qxj") - .withConfiguration( - new Configuration() - .withSecrets( - Arrays - .asList( - new Secret().withName("ijhtxf").withValue("xbf"), - new Secret().withName("xnehmpvec").withValue("odebfqkkrbmpu"), - new Secret().withName("riwflzlfb").withValue("puz"))) - .withActiveRevisionsMode(ActiveRevisionsMode.SINGLE) - .withIngress( - new Ingress() - .withExternal(true) - .withTargetPort(1877210635) - .withExposedPort(2043148337) - .withTransport(IngressTransportMethod.HTTP) - .withTraffic(Arrays.asList()) - .withCustomDomains(Arrays.asList()) - .withAllowInsecure(true) - .withIpSecurityRestrictions(Arrays.asList())) - .withRegistries( - Arrays - .asList( - new RegistryCredentials() - .withServer("n") - .withUsername("ynhijggme") - .withPasswordSecretRef("siarbutrcvpn") - .withIdentity("zmhjrunmp"))) - .withDapr( - new Dapr() - .withEnabled(true) - .withAppId("hrbnlankxmyskpbh") - .withAppProtocol(AppProtocol.GRPC) - .withAppPort(2131694851) - .withHttpReadBufferSize(2016648328) - .withHttpMaxRequestSize(83692384) - .withLogLevel(LogLevel.INFO) - .withEnableApiLogging(false)) - .withMaxInactiveRevisions(1863766018)) - .withTemplate( - new Template() - .withRevisionSuffix("lqidyby") - .withInitContainers( - Arrays - .asList( - new InitContainer() - .withImage("clha") - .withName("dbabp") - .withCommand(Arrays.asList()) - .withArgs(Arrays.asList()) - .withEnv(Arrays.asList()) - .withVolumeMounts(Arrays.asList()))) - .withContainers( - Arrays - .asList( - new Container() - .withImage("thsu") - .withName("cmnyyazttb") - .withCommand(Arrays.asList()) - .withArgs(Arrays.asList()) - .withEnv(Arrays.asList()) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()), - new Container() - .withImage("dckzywbiexz") - .withName("yueaxibxujwb") - .withCommand(Arrays.asList()) - .withArgs(Arrays.asList()) - .withEnv(Arrays.asList()) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()), - new Container() - .withImage("yoxa") - .withName("dkzjancuxrh") - .withCommand(Arrays.asList()) - .withArgs(Arrays.asList()) - .withEnv(Arrays.asList()) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()), - new Container() - .withImage("iwdjswztsdbpgn") - .withName("txhp") - .withCommand(Arrays.asList()) - .withArgs(Arrays.asList()) - .withEnv(Arrays.asList()) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()))) - .withScale( - new Scale() - .withMinReplicas(262767805) - .withMaxReplicas(1638223797) - .withRules(Arrays.asList())) - .withVolumes( - Arrays - .asList( - new Volume() - .withName("tcty") - .withStorageType(StorageType.AZURE_FILE) - .withStorageName("bbovplwzbhvgyugu"), - new Volume() - .withName("vmkfssxqu") - .withStorageType(StorageType.AZURE_FILE) - .withStorageName("l"), - new Volume() - .withName("gsxnkjzkdeslpv") - .withStorageType(StorageType.AZURE_FILE) - .withStorageName("i"), - new Volume() - .withName("ghxpkdw") - .withStorageType(StorageType.EMPTY_DIR) - .withStorageName("uebbaumnyqup")))); - model = BinaryData.fromObject(model).toObject(ContainerAppProperties.class); - Assertions.assertEquals("i", model.managedEnvironmentId()); - Assertions.assertEquals("hxepcyvahfnlj", model.environmentId()); - Assertions.assertEquals("qxj", model.workloadProfileType()); - Assertions.assertEquals("ijhtxf", model.configuration().secrets().get(0).name()); - Assertions.assertEquals("xbf", model.configuration().secrets().get(0).value()); - Assertions.assertEquals(ActiveRevisionsMode.SINGLE, model.configuration().activeRevisionsMode()); - Assertions.assertEquals(true, model.configuration().ingress().external()); - Assertions.assertEquals(1877210635, model.configuration().ingress().targetPort()); - Assertions.assertEquals(2043148337, model.configuration().ingress().exposedPort()); - Assertions.assertEquals(IngressTransportMethod.HTTP, model.configuration().ingress().transport()); - Assertions.assertEquals(true, model.configuration().ingress().allowInsecure()); - Assertions.assertEquals("n", model.configuration().registries().get(0).server()); - Assertions.assertEquals("ynhijggme", model.configuration().registries().get(0).username()); - Assertions.assertEquals("siarbutrcvpn", model.configuration().registries().get(0).passwordSecretRef()); - Assertions.assertEquals("zmhjrunmp", model.configuration().registries().get(0).identity()); - Assertions.assertEquals(true, model.configuration().dapr().enabled()); - Assertions.assertEquals("hrbnlankxmyskpbh", model.configuration().dapr().appId()); - Assertions.assertEquals(AppProtocol.GRPC, model.configuration().dapr().appProtocol()); - Assertions.assertEquals(2131694851, model.configuration().dapr().appPort()); - Assertions.assertEquals(2016648328, model.configuration().dapr().httpReadBufferSize()); - Assertions.assertEquals(83692384, model.configuration().dapr().httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.INFO, model.configuration().dapr().logLevel()); - Assertions.assertEquals(false, model.configuration().dapr().enableApiLogging()); - Assertions.assertEquals(1863766018, model.configuration().maxInactiveRevisions()); - Assertions.assertEquals("lqidyby", model.template().revisionSuffix()); - Assertions.assertEquals("clha", model.template().initContainers().get(0).image()); - Assertions.assertEquals("dbabp", model.template().initContainers().get(0).name()); - Assertions.assertEquals("thsu", model.template().containers().get(0).image()); - Assertions.assertEquals("cmnyyazttb", model.template().containers().get(0).name()); - Assertions.assertEquals(262767805, model.template().scale().minReplicas()); - Assertions.assertEquals(1638223797, model.template().scale().maxReplicas()); - Assertions.assertEquals("tcty", model.template().volumes().get(0).name()); - Assertions.assertEquals(StorageType.AZURE_FILE, model.template().volumes().get(0).storageType()); - Assertions.assertEquals("bbovplwzbhvgyugu", model.template().volumes().get(0).storageName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppSecretTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppSecretTests.java deleted file mode 100644 index 084242df7a48a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppSecretTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerAppSecret; -import org.junit.jupiter.api.Test; - -public final class ContainerAppSecretTests { - @Test - public void testDeserialize() { - ContainerAppSecret model = - BinaryData - .fromString("{\"name\":\"deibqip\",\"value\":\"ghvxndzwmkrefa\"}") - .toObject(ContainerAppSecret.class); - } - - @Test - public void testSerialize() { - ContainerAppSecret model = new ContainerAppSecret(); - model = BinaryData.fromObject(model).toObject(ContainerAppSecret.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppMockTests.java deleted file mode 100644 index 11a175e7be13a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsAuthConfigsListByContainerAppMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.AuthConfig; -import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsAuthConfigsListByContainerAppMockTests { - @Test - public void testListByContainerApp() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"platform\":{\"enabled\":false,\"runtimeVersion\":\"vz\"},\"globalValidation\":{\"unauthenticatedClientAction\":\"RedirectToLoginPage\",\"redirectToProvider\":\"fbzdixzmqpnoda\",\"excludedPaths\":[]},\"identityProviders\":{\"customOpenIdConnectProviders\":{}},\"login\":{\"preserveUrlFragmentsForLogins\":false,\"allowedExternalRedirectUrls\":[]},\"httpSettings\":{\"requireHttps\":false}},\"id\":\"atutmzlbiojlvfhr\",\"name\":\"bpneqvcwwyyurm\",\"type\":\"chpp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.containerAppsAuthConfigs().listByContainerApp("fezrx", "czurtlei", Context.NONE); - - Assertions.assertEquals(false, response.iterator().next().platform().enabled()); - Assertions.assertEquals("vz", response.iterator().next().platform().runtimeVersion()); - Assertions - .assertEquals( - UnauthenticatedClientActionV2.REDIRECT_TO_LOGIN_PAGE, - response.iterator().next().globalValidation().unauthenticatedClientAction()); - Assertions.assertEquals("fbzdixzmqpnoda", response.iterator().next().globalValidation().redirectToProvider()); - Assertions.assertEquals(false, response.iterator().next().login().preserveUrlFragmentsForLogins()); - Assertions.assertEquals(false, response.iterator().next().httpSettings().requireHttps()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateMockTests.java deleted file mode 100644 index 2a395092867a7..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; -import com.azure.resourcemanager.appcontainers.models.Configuration; -import com.azure.resourcemanager.appcontainers.models.ContainerApp; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.appcontainers.models.Template; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"extendedLocation\":{\"name\":\"kiwbuqnyoph\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Succeeded\",\"managedEnvironmentId\":\"nezzcezelfwyfwlw\",\"environmentId\":\"wetnpsihc\",\"workloadProfileType\":\"fzvaylptr\",\"latestRevisionName\":\"qwztcmwqkc\",\"latestRevisionFqdn\":\"xwaxfewzjkj\",\"customDomainVerificationId\":\"fdeqvhpsyl\",\"configuration\":{\"secrets\":[],\"activeRevisionsMode\":\"Multiple\",\"registries\":[],\"maxInactiveRevisions\":919245965},\"template\":{\"revisionSuffix\":\"zjrgyww\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"outboundIpAddresses\":[\"tf\",\"jgicgaao\",\"pttaqutd\",\"wemxswvruunzz\"],\"eventStreamEndpoint\":\"ehkfkimrtixok\"},\"location\":\"qyinl\",\"tags\":{\"hiyxgvelfclduc\":\"pqwhixmonst\"},\"id\":\"birdsvuwcobiegs\",\"name\":\"mninwjizcilng\",\"type\":\"gshejjtbxqmulux\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ContainerApp response = - manager - .containerApps() - .define("fgtayxonsup") - .withRegion("rylniofrzg") - .withExistingResourceGroup("mv") - .withTags(mapOf("tkvnlvxbcuiiznkt", "edm")) - .withExtendedLocation( - new ExtendedLocation().withName("lzqnhcvs").withType(ExtendedLocationTypes.CUSTOM_LOCATION)) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf())) - .withManagedEnvironmentId("xfyqonmpqoxwdo") - .withEnvironmentId("bxiqxeiiqbimht") - .withWorkloadProfileType("winhehfqpo") - .withConfiguration( - new Configuration() - .withSecrets(Arrays.asList()) - .withActiveRevisionsMode(ActiveRevisionsMode.MULTIPLE) - .withRegistries(Arrays.asList()) - .withMaxInactiveRevisions(1610520770)) - .withTemplate( - new Template() - .withRevisionSuffix("zuwfmdur") - .withInitContainers(Arrays.asList()) - .withContainers(Arrays.asList()) - .withVolumes(Arrays.asList())) - .create(); - - Assertions.assertEquals("qyinl", response.location()); - Assertions.assertEquals("pqwhixmonst", response.tags().get("hiyxgvelfclduc")); - Assertions.assertEquals("kiwbuqnyoph", response.extendedLocation().name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, response.extendedLocation().type()); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("nezzcezelfwyfwlw", response.managedEnvironmentId()); - Assertions.assertEquals("wetnpsihc", response.environmentId()); - Assertions.assertEquals("fzvaylptr", response.workloadProfileType()); - Assertions.assertEquals(ActiveRevisionsMode.MULTIPLE, response.configuration().activeRevisionsMode()); - Assertions.assertEquals(919245965, response.configuration().maxInactiveRevisions()); - Assertions.assertEquals("zjrgyww", response.template().revisionSuffix()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteMockTests.java deleted file mode 100644 index bd21d8edc4a57..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerApps().delete("ljhlnymzotq", "ryuzcbmqqv", Context.NONE); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsMockTests.java deleted file mode 100644 index ad2bcd84fa701..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListDetectorsMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Diagnostics; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsDiagnosticsListDetectorsMockTests { - @Test - public void testListDetectors() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"metadata\":{\"id\":\"eq\",\"name\":\"arvlagunbt\",\"description\":\"ebwlnbmhyreeudzq\",\"author\":\"bpdqmjxlyy\",\"category\":\"lgouwtlmjj\",\"supportTopicList\":[],\"analysisTypes\":[],\"type\":\"qtobaxkjeyt\",\"score\":38.508713},\"dataset\":[],\"status\":{\"message\":\"wrus\",\"statusId\":1630715289},\"dataProviderMetadata\":{\"providerName\":\"syrq\",\"propertyBag\":[]}},\"id\":\"qhd\",\"name\":\"nxaulk\",\"type\":\"akdkifmjnnawtqab\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.containerAppsDiagnostics().listDetectors("tz", "atbhjmznn", Context.NONE); - - Assertions.assertEquals("wrus", response.iterator().next().properties().status().message()); - Assertions.assertEquals(1630715289, response.iterator().next().properties().status().statusId()); - Assertions.assertEquals("syrq", response.iterator().next().properties().dataProviderMetadata().providerName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsMockTests.java deleted file mode 100644 index 42bf66cb1ba88..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsDiagnosticsListRevisionsMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Revision; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsDiagnosticsListRevisionsMockTests { - @Test - public void testListRevisions() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-09-23T09:27:28Z\",\"lastActiveTime\":\"2021-02-12T07:54:43Z\",\"fqdn\":\"pxiwf\",\"template\":{\"revisionSuffix\":\"jsa\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"active\":true,\"replicas\":1850415836,\"trafficWeight\":337037006,\"provisioningError\":\"viirhgfgrws\",\"healthState\":\"Unhealthy\",\"provisioningState\":\"Provisioning\"},\"id\":\"zvzbglbyv\",\"name\":\"ctctbrxkjz\",\"type\":\"rgxffmshkw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.containerAppsDiagnostics().listRevisions("xuckpggqoweyir", "hlisngw", "lqqmpiz", Context.NONE); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupMockTests.java deleted file mode 100644 index 7b4533edc0b2b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListByResourceGroupMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; -import com.azure.resourcemanager.appcontainers.models.ContainerApp; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"extendedLocation\":{\"name\":\"f\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"Canceled\",\"managedEnvironmentId\":\"s\",\"environmentId\":\"rioov\",\"workloadProfileType\":\"dsxwaab\",\"latestRevisionName\":\"ifrygzn\",\"latestRevisionFqdn\":\"axri\",\"customDomainVerificationId\":\"zob\",\"configuration\":{\"secrets\":[],\"activeRevisionsMode\":\"Single\",\"registries\":[],\"maxInactiveRevisions\":1673403007},\"template\":{\"revisionSuffix\":\"ieixynllxe\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"outboundIpAddresses\":[\"hslhca\",\"jutifdwfmvigorqj\",\"ttzhra\",\"lkafhonqjuje\"],\"eventStreamEndpoint\":\"kpzvcpopmxelnwc\"},\"location\":\"yjede\",\"tags\":{\"scazuawxtzxpu\":\"lfmk\",\"s\":\"mwabzxrvxc\"},\"id\":\"sphaivmxyasflvg\",\"name\":\"gzwywak\",\"type\":\"ihknsmjbl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.containerApps().listByResourceGroup("ptgoeiybbabp", Context.NONE); - - Assertions.assertEquals("yjede", response.iterator().next().location()); - Assertions.assertEquals("lfmk", response.iterator().next().tags().get("scazuawxtzxpu")); - Assertions.assertEquals("f", response.iterator().next().extendedLocation().name()); - Assertions - .assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, response.iterator().next().extendedLocation().type()); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("s", response.iterator().next().managedEnvironmentId()); - Assertions.assertEquals("rioov", response.iterator().next().environmentId()); - Assertions.assertEquals("dsxwaab", response.iterator().next().workloadProfileType()); - Assertions - .assertEquals(ActiveRevisionsMode.SINGLE, response.iterator().next().configuration().activeRevisionsMode()); - Assertions.assertEquals(1673403007, response.iterator().next().configuration().maxInactiveRevisions()); - Assertions.assertEquals("ieixynllxe", response.iterator().next().template().revisionSuffix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListMockTests.java deleted file mode 100644 index b5de8d1f9c262..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.ActiveRevisionsMode; -import com.azure.resourcemanager.appcontainers.models.ContainerApp; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"extendedLocation\":{\"name\":\"snmokayzej\",\"type\":\"CustomLocation\"},\"identity\":{\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{}},\"properties\":{\"provisioningState\":\"InProgress\",\"managedEnvironmentId\":\"jh\",\"environmentId\":\"zv\",\"workloadProfileType\":\"h\",\"latestRevisionName\":\"bnwieholew\",\"latestRevisionFqdn\":\"iuubwefqsf\",\"customDomainVerificationId\":\"aqtferr\",\"configuration\":{\"secrets\":[],\"activeRevisionsMode\":\"Single\",\"registries\":[],\"maxInactiveRevisions\":2076529802},\"template\":{\"revisionSuffix\":\"wogqqnobpudcdab\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"outboundIpAddresses\":[\"wbzasqbuclj\",\"kyexaoguyaipi\"],\"eventStreamEndpoint\":\"daultxijjumfq\"},\"location\":\"z\",\"tags\":{\"jng\":\"nm\",\"bjwgnyfus\":\"qdqx\",\"fh\":\"zsvtuikzhajqgl\"},\"id\":\"l\",\"name\":\"qryxyn\",\"type\":\"nzrdpsovwxz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.containerApps().list(Context.NONE); - - Assertions.assertEquals("z", response.iterator().next().location()); - Assertions.assertEquals("nm", response.iterator().next().tags().get("jng")); - Assertions.assertEquals("snmokayzej", response.iterator().next().extendedLocation().name()); - Assertions - .assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, response.iterator().next().extendedLocation().type()); - Assertions - .assertEquals( - ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("jh", response.iterator().next().managedEnvironmentId()); - Assertions.assertEquals("zv", response.iterator().next().environmentId()); - Assertions.assertEquals("h", response.iterator().next().workloadProfileType()); - Assertions - .assertEquals(ActiveRevisionsMode.SINGLE, response.iterator().next().configuration().activeRevisionsMode()); - Assertions.assertEquals(2076529802, response.iterator().next().configuration().maxInactiveRevisions()); - Assertions.assertEquals("wogqqnobpudcdab", response.iterator().next().template().revisionSuffix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsMockTests.java deleted file mode 100644 index ddca831f448b6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsRevisionsListRevisionsMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.Revision; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsRevisionsListRevisionsMockTests { - @Test - public void testListRevisions() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-03-07T21:38:43Z\",\"lastActiveTime\":\"2021-11-24T18:55:58Z\",\"fqdn\":\"ziqgfuh\",\"template\":{\"revisionSuffix\":\"ruswhv\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"active\":false,\"replicas\":1235050131,\"trafficWeight\":1910463572,\"provisioningError\":\"xjww\",\"healthState\":\"Unhealthy\",\"provisioningState\":\"Provisioning\"},\"id\":\"wmxqhndvnoamlds\",\"name\":\"haohdjhhflzokxc\",\"type\":\"xpelnjetagltsx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.containerAppsRevisions().listRevisions("xqzv", "ers", "ycucrwnamikzeb", Context.NONE); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateMockTests.java deleted file mode 100644 index f06d91975a1dc..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; -import com.azure.resourcemanager.appcontainers.models.SourceControl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsSourceControlsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"operationState\":\"InProgress\",\"repoUrl\":\"k\",\"branch\":\"qirwrweoox\",\"githubActionConfiguration\":{\"contextPath\":\"xwrsnew\",\"image\":\"zqvbubqm\",\"publishType\":\"hsycxhxzgaz\",\"os\":\"abo\",\"runtimeStack\":\"vmfqhppubo\",\"runtimeVersion\":\"epdfgkmtdherng\"}},\"id\":\"c\",\"name\":\"uahokq\",\"type\":\"obkauxofsh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SourceControl response = - manager - .containerAppsSourceControls() - .define("btozipqwje") - .withExistingContainerApp("neiknpg", "xgjiuqh") - .withRepoUrl("xxgewpk") - .withBranch("qylkmqpzoyhlf") - .withGithubActionConfiguration( - new GithubActionConfiguration() - .withContextPath("cloxo") - .withImage("qinjipnwjf") - .withPublishType("qlafcbahhpzpofoi") - .withOs("w") - .withRuntimeStack("ilkmk") - .withRuntimeVersion("olvdnd")) - .create(); - - Assertions.assertEquals("k", response.repoUrl()); - Assertions.assertEquals("qirwrweoox", response.branch()); - Assertions.assertEquals("xwrsnew", response.githubActionConfiguration().contextPath()); - Assertions.assertEquals("zqvbubqm", response.githubActionConfiguration().image()); - Assertions.assertEquals("hsycxhxzgaz", response.githubActionConfiguration().publishType()); - Assertions.assertEquals("abo", response.githubActionConfiguration().os()); - Assertions.assertEquals("vmfqhppubo", response.githubActionConfiguration().runtimeStack()); - Assertions.assertEquals("epdfgkmtdherng", response.githubActionConfiguration().runtimeVersion()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteMockTests.java deleted file mode 100644 index 210da113c01d1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsSourceControlsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.containerAppsSourceControls().delete("vtxnjmxmcuqud", "cvclxynpdk", "gfabuiyjibuzphdu", Context.NONE); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppMockTests.java deleted file mode 100644 index 485e870c2ee3b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerAppsSourceControlsListByContainerAppMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.SourceControl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ContainerAppsSourceControlsListByContainerAppMockTests { - @Test - public void testListByContainerApp() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"operationState\":\"Canceled\",\"repoUrl\":\"zszuwiwtglxx\",\"branch\":\"jfpgpicrmn\",\"githubActionConfiguration\":{\"contextPath\":\"qgjsxvpqcbfrmbod\",\"image\":\"s\",\"publishType\":\"gvriibakclac\",\"os\":\"rnxousxauzlwvsg\",\"runtimeStack\":\"ohqfzizv\",\"runtimeVersion\":\"mmkjsvthnwpztek\"}},\"id\":\"mribiat\",\"name\":\"gplucfotangcfhny\",\"type\":\"zcugswvxwlmzqw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .containerAppsSourceControls() - .listByContainerApp("zdfuydzvkfvxcnqm", "qpswokmvkhlggdhb", Context.NONE); - - Assertions.assertEquals("zszuwiwtglxx", response.iterator().next().repoUrl()); - Assertions.assertEquals("jfpgpicrmn", response.iterator().next().branch()); - Assertions - .assertEquals("qgjsxvpqcbfrmbod", response.iterator().next().githubActionConfiguration().contextPath()); - Assertions.assertEquals("s", response.iterator().next().githubActionConfiguration().image()); - Assertions.assertEquals("gvriibakclac", response.iterator().next().githubActionConfiguration().publishType()); - Assertions.assertEquals("rnxousxauzlwvsg", response.iterator().next().githubActionConfiguration().os()); - Assertions.assertEquals("ohqfzizv", response.iterator().next().githubActionConfiguration().runtimeStack()); - Assertions - .assertEquals("mmkjsvthnwpztek", response.iterator().next().githubActionConfiguration().runtimeVersion()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerResourcesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerResourcesTests.java deleted file mode 100644 index e885f4068cb83..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerResourcesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerResourcesTests { - @Test - public void testDeserialize() { - ContainerResources model = - BinaryData - .fromString( - "{\"cpu\":4.018076144198646,\"memory\":\"byuqerpqlp\",\"ephemeralStorage\":\"cciuqgbdbutau\"}") - .toObject(ContainerResources.class); - Assertions.assertEquals(4.018076144198646D, model.cpu()); - Assertions.assertEquals("byuqerpqlp", model.memory()); - } - - @Test - public void testSerialize() { - ContainerResources model = new ContainerResources().withCpu(4.018076144198646D).withMemory("byuqerpqlp"); - model = BinaryData.fromObject(model).toObject(ContainerResources.class); - Assertions.assertEquals(4.018076144198646D, model.cpu()); - Assertions.assertEquals("byuqerpqlp", model.memory()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerTests.java deleted file mode 100644 index 7f5492f8531fa..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ContainerTests.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbe; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeHttpGet; -import com.azure.resourcemanager.appcontainers.models.ContainerAppProbeTcpSocket; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; -import com.azure.resourcemanager.appcontainers.models.Scheme; -import com.azure.resourcemanager.appcontainers.models.Type; -import com.azure.resourcemanager.appcontainers.models.VolumeMount; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ContainerTests { - @Test - public void testDeserialize() { - Container model = - BinaryData - .fromString( - "{\"probes\":[{\"failureThreshold\":1847154217,\"httpGet\":{\"host\":\"dyh\",\"httpHeaders\":[],\"path\":\"kpw\",\"port\":722591670,\"scheme\":\"HTTP\"},\"initialDelaySeconds\":1405054510,\"periodSeconds\":436930302,\"successThreshold\":217402337,\"tcpSocket\":{\"host\":\"ljxywsu\",\"port\":2009471016},\"terminationGracePeriodSeconds\":6037040030407661019,\"timeoutSeconds\":371488938,\"type\":\"Readiness\"}],\"image\":\"g\",\"name\":\"gvraeaen\",\"command\":[\"zar\"],\"args\":[\"q\",\"uijfqk\",\"cewiipfpub\",\"ibwwiftohqkv\"],\"env\":[{\"name\":\"sgplsakn\",\"value\":\"fsynljphuop\",\"secretRef\":\"dlqiyntorzih\"},{\"name\":\"osjswsr\",\"value\":\"lyzrpzbchckqqzqi\",\"secretRef\":\"iysui\"},{\"name\":\"ynkedyatrwyhqmib\",\"value\":\"hwit\",\"secretRef\":\"ypyynpcdpumnzg\"},{\"name\":\"z\",\"value\":\"abikns\",\"secretRef\":\"gj\"}],\"resources\":{\"cpu\":40.86477682375702,\"memory\":\"lwwrl\",\"ephemeralStorage\":\"m\"},\"volumeMounts\":[{\"volumeName\":\"ok\",\"mountPath\":\"llxdyhgs\"},{\"volumeName\":\"cogjltdtbn\",\"mountPath\":\"adoocrkvc\"},{\"volumeName\":\"hnvpamqgxq\",\"mountPath\":\"ezikywggxkal\"},{\"volumeName\":\"tmelw\",\"mountPath\":\"piccjzkzivgv\"}]}") - .toObject(Container.class); - Assertions.assertEquals("g", model.image()); - Assertions.assertEquals("gvraeaen", model.name()); - Assertions.assertEquals("zar", model.command().get(0)); - Assertions.assertEquals("q", model.args().get(0)); - Assertions.assertEquals("sgplsakn", model.env().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.env().get(0).value()); - Assertions.assertEquals("dlqiyntorzih", model.env().get(0).secretRef()); - Assertions.assertEquals(40.86477682375702D, model.resources().cpu()); - Assertions.assertEquals("lwwrl", model.resources().memory()); - Assertions.assertEquals("ok", model.volumeMounts().get(0).volumeName()); - Assertions.assertEquals("llxdyhgs", model.volumeMounts().get(0).mountPath()); - Assertions.assertEquals(1847154217, model.probes().get(0).failureThreshold()); - Assertions.assertEquals("dyh", model.probes().get(0).httpGet().host()); - Assertions.assertEquals("kpw", model.probes().get(0).httpGet().path()); - Assertions.assertEquals(722591670, model.probes().get(0).httpGet().port()); - Assertions.assertEquals(Scheme.HTTP, model.probes().get(0).httpGet().scheme()); - Assertions.assertEquals(1405054510, model.probes().get(0).initialDelaySeconds()); - Assertions.assertEquals(436930302, model.probes().get(0).periodSeconds()); - Assertions.assertEquals(217402337, model.probes().get(0).successThreshold()); - Assertions.assertEquals("ljxywsu", model.probes().get(0).tcpSocket().host()); - Assertions.assertEquals(2009471016, model.probes().get(0).tcpSocket().port()); - Assertions.assertEquals(6037040030407661019L, model.probes().get(0).terminationGracePeriodSeconds()); - Assertions.assertEquals(371488938, model.probes().get(0).timeoutSeconds()); - Assertions.assertEquals(Type.READINESS, model.probes().get(0).type()); - } - - @Test - public void testSerialize() { - Container model = - new Container() - .withImage("g") - .withName("gvraeaen") - .withCommand(Arrays.asList("zar")) - .withArgs(Arrays.asList("q", "uijfqk", "cewiipfpub", "ibwwiftohqkv")) - .withEnv( - Arrays - .asList( - new EnvironmentVar() - .withName("sgplsakn") - .withValue("fsynljphuop") - .withSecretRef("dlqiyntorzih"), - new EnvironmentVar() - .withName("osjswsr") - .withValue("lyzrpzbchckqqzqi") - .withSecretRef("iysui"), - new EnvironmentVar() - .withName("ynkedyatrwyhqmib") - .withValue("hwit") - .withSecretRef("ypyynpcdpumnzg"), - new EnvironmentVar().withName("z").withValue("abikns").withSecretRef("gj"))) - .withResources(new ContainerResources().withCpu(40.86477682375702D).withMemory("lwwrl")) - .withVolumeMounts( - Arrays - .asList( - new VolumeMount().withVolumeName("ok").withMountPath("llxdyhgs"), - new VolumeMount().withVolumeName("cogjltdtbn").withMountPath("adoocrkvc"), - new VolumeMount().withVolumeName("hnvpamqgxq").withMountPath("ezikywggxkal"), - new VolumeMount().withVolumeName("tmelw").withMountPath("piccjzkzivgv"))) - .withProbes( - Arrays - .asList( - new ContainerAppProbe() - .withFailureThreshold(1847154217) - .withHttpGet( - new ContainerAppProbeHttpGet() - .withHost("dyh") - .withHttpHeaders(Arrays.asList()) - .withPath("kpw") - .withPort(722591670) - .withScheme(Scheme.HTTP)) - .withInitialDelaySeconds(1405054510) - .withPeriodSeconds(436930302) - .withSuccessThreshold(217402337) - .withTcpSocket( - new ContainerAppProbeTcpSocket().withHost("ljxywsu").withPort(2009471016)) - .withTerminationGracePeriodSeconds(6037040030407661019L) - .withTimeoutSeconds(371488938) - .withType(Type.READINESS))); - model = BinaryData.fromObject(model).toObject(Container.class); - Assertions.assertEquals("g", model.image()); - Assertions.assertEquals("gvraeaen", model.name()); - Assertions.assertEquals("zar", model.command().get(0)); - Assertions.assertEquals("q", model.args().get(0)); - Assertions.assertEquals("sgplsakn", model.env().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.env().get(0).value()); - Assertions.assertEquals("dlqiyntorzih", model.env().get(0).secretRef()); - Assertions.assertEquals(40.86477682375702D, model.resources().cpu()); - Assertions.assertEquals("lwwrl", model.resources().memory()); - Assertions.assertEquals("ok", model.volumeMounts().get(0).volumeName()); - Assertions.assertEquals("llxdyhgs", model.volumeMounts().get(0).mountPath()); - Assertions.assertEquals(1847154217, model.probes().get(0).failureThreshold()); - Assertions.assertEquals("dyh", model.probes().get(0).httpGet().host()); - Assertions.assertEquals("kpw", model.probes().get(0).httpGet().path()); - Assertions.assertEquals(722591670, model.probes().get(0).httpGet().port()); - Assertions.assertEquals(Scheme.HTTP, model.probes().get(0).httpGet().scheme()); - Assertions.assertEquals(1405054510, model.probes().get(0).initialDelaySeconds()); - Assertions.assertEquals(436930302, model.probes().get(0).periodSeconds()); - Assertions.assertEquals(217402337, model.probes().get(0).successThreshold()); - Assertions.assertEquals("ljxywsu", model.probes().get(0).tcpSocket().host()); - Assertions.assertEquals(2009471016, model.probes().get(0).tcpSocket().port()); - Assertions.assertEquals(6037040030407661019L, model.probes().get(0).terminationGracePeriodSeconds()); - Assertions.assertEquals(371488938, model.probes().get(0).timeoutSeconds()); - Assertions.assertEquals(Type.READINESS, model.probes().get(0).type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CookieExpirationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CookieExpirationTests.java deleted file mode 100644 index b40309ff25bf9..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CookieExpirationTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CookieExpiration; -import com.azure.resourcemanager.appcontainers.models.CookieExpirationConvention; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CookieExpirationTests { - @Test - public void testDeserialize() { - CookieExpiration model = - BinaryData - .fromString("{\"convention\":\"IdentityProviderDerived\",\"timeToExpiration\":\"cftadeh\"}") - .toObject(CookieExpiration.class); - Assertions.assertEquals(CookieExpirationConvention.IDENTITY_PROVIDER_DERIVED, model.convention()); - Assertions.assertEquals("cftadeh", model.timeToExpiration()); - } - - @Test - public void testSerialize() { - CookieExpiration model = - new CookieExpiration() - .withConvention(CookieExpirationConvention.IDENTITY_PROVIDER_DERIVED) - .withTimeToExpiration("cftadeh"); - model = BinaryData.fromObject(model).toObject(CookieExpiration.class); - Assertions.assertEquals(CookieExpirationConvention.IDENTITY_PROVIDER_DERIVED, model.convention()); - Assertions.assertEquals("cftadeh", model.timeToExpiration()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainConfigurationTests.java deleted file mode 100644 index 83c04a1b68717..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainConfigurationTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CustomDomainConfiguration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomDomainConfigurationTests { - @Test - public void testDeserialize() { - CustomDomainConfiguration model = - BinaryData - .fromString( - "{\"customDomainVerificationId\":\"lbfu\",\"dnsSuffix\":\"lyjt\",\"expirationDate\":\"2021-08-04T14:40:51Z\",\"thumbprint\":\"hvfcibyfmow\",\"subjectName\":\"rkjpvdwxfzwii\"}") - .toObject(CustomDomainConfiguration.class); - Assertions.assertEquals("lyjt", model.dnsSuffix()); - } - - @Test - public void testSerialize() { - CustomDomainConfiguration model = new CustomDomainConfiguration().withDnsSuffix("lyjt"); - model = BinaryData.fromObject(model).toObject(CustomDomainConfiguration.class); - Assertions.assertEquals("lyjt", model.dnsSuffix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainTests.java deleted file mode 100644 index 7022182d6ee2a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomDomainTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomDomainTests { - @Test - public void testDeserialize() { - CustomDomain model = - BinaryData - .fromString( - "{\"name\":\"hfxobbcswsrtj\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"lrbpbewtghfgbl\"}") - .toObject(CustomDomain.class); - Assertions.assertEquals("hfxobbcswsrtj", model.name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, model.bindingType()); - Assertions.assertEquals("lrbpbewtghfgbl", model.certificateId()); - } - - @Test - public void testSerialize() { - CustomDomain model = - new CustomDomain() - .withName("hfxobbcswsrtj") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("lrbpbewtghfgbl"); - model = BinaryData.fromObject(model).toObject(CustomDomain.class); - Assertions.assertEquals("hfxobbcswsrtj", model.name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, model.bindingType()); - Assertions.assertEquals("lrbpbewtghfgbl", model.certificateId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomScaleRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomScaleRuleTests.java deleted file mode 100644 index 5fc1539d6a671..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/CustomScaleRuleTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; -import com.azure.resourcemanager.appcontainers.models.ScaleRuleAuth; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class CustomScaleRuleTests { - @Test - public void testDeserialize() { - CustomScaleRule model = - BinaryData - .fromString( - "{\"type\":\"gsahmkycgrauw\",\"metadata\":{\"vsmzlxwab\":\"taeburuvdm\",\"efkifr\":\"q\"},\"auth\":[{\"secretRef\":\"qujmqlgkf\",\"triggerParameter\":\"ndo\"},{\"secretRef\":\"n\",\"triggerParameter\":\"jcntuj\"},{\"secretRef\":\"c\",\"triggerParameter\":\"df\"},{\"secretRef\":\"waezkojvd\",\"triggerParameter\":\"zfoqouicybxar\"}]}") - .toObject(CustomScaleRule.class); - Assertions.assertEquals("gsahmkycgrauw", model.type()); - Assertions.assertEquals("taeburuvdm", model.metadata().get("vsmzlxwab")); - Assertions.assertEquals("qujmqlgkf", model.auth().get(0).secretRef()); - Assertions.assertEquals("ndo", model.auth().get(0).triggerParameter()); - } - - @Test - public void testSerialize() { - CustomScaleRule model = - new CustomScaleRule() - .withType("gsahmkycgrauw") - .withMetadata(mapOf("vsmzlxwab", "taeburuvdm", "efkifr", "q")) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("qujmqlgkf").withTriggerParameter("ndo"), - new ScaleRuleAuth().withSecretRef("n").withTriggerParameter("jcntuj"), - new ScaleRuleAuth().withSecretRef("c").withTriggerParameter("df"), - new ScaleRuleAuth().withSecretRef("waezkojvd").withTriggerParameter("zfoqouicybxar"))); - model = BinaryData.fromObject(model).toObject(CustomScaleRule.class); - Assertions.assertEquals("gsahmkycgrauw", model.type()); - Assertions.assertEquals("taeburuvdm", model.metadata().get("vsmzlxwab")); - Assertions.assertEquals("qujmqlgkf", model.auth().get(0).secretRef()); - Assertions.assertEquals("ndo", model.auth().get(0).triggerParameter()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentInnerTests.java deleted file mode 100644 index 983fad9cfb750..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentInnerTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; -import com.azure.resourcemanager.appcontainers.models.DaprMetadata; -import com.azure.resourcemanager.appcontainers.models.Secret; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DaprComponentInnerTests { - @Test - public void testDeserialize() { - DaprComponentInner model = - BinaryData - .fromString( - "{\"properties\":{\"componentType\":\"nrojlpijnkr\",\"version\":\"rddh\",\"ignoreErrors\":false,\"initTimeout\":\"izzronasxiftozqy\",\"secrets\":[{\"name\":\"wesgogczh\",\"value\":\"nxkrlgnyhmossxkk\"}],\"secretStoreComponent\":\"h\",\"metadata\":[{\"name\":\"xjb\",\"value\":\"qxvcxgfrpdsofb\",\"secretRef\":\"rnsvbuswd\"}],\"scopes\":[\"ybycnunvj\",\"rtkfawnopq\"]},\"id\":\"kyzirtxdyux\",\"name\":\"ejnt\",\"type\":\"sewgioilqukr\"}") - .toObject(DaprComponentInner.class); - Assertions.assertEquals("nrojlpijnkr", model.componentType()); - Assertions.assertEquals("rddh", model.version()); - Assertions.assertEquals(false, model.ignoreErrors()); - Assertions.assertEquals("izzronasxiftozqy", model.initTimeout()); - Assertions.assertEquals("wesgogczh", model.secrets().get(0).name()); - Assertions.assertEquals("nxkrlgnyhmossxkk", model.secrets().get(0).value()); - Assertions.assertEquals("h", model.secretStoreComponent()); - Assertions.assertEquals("xjb", model.metadata().get(0).name()); - Assertions.assertEquals("qxvcxgfrpdsofb", model.metadata().get(0).value()); - Assertions.assertEquals("rnsvbuswd", model.metadata().get(0).secretRef()); - Assertions.assertEquals("ybycnunvj", model.scopes().get(0)); - } - - @Test - public void testSerialize() { - DaprComponentInner model = - new DaprComponentInner() - .withComponentType("nrojlpijnkr") - .withVersion("rddh") - .withIgnoreErrors(false) - .withInitTimeout("izzronasxiftozqy") - .withSecrets(Arrays.asList(new Secret().withName("wesgogczh").withValue("nxkrlgnyhmossxkk"))) - .withSecretStoreComponent("h") - .withMetadata( - Arrays - .asList( - new DaprMetadata().withName("xjb").withValue("qxvcxgfrpdsofb").withSecretRef("rnsvbuswd"))) - .withScopes(Arrays.asList("ybycnunvj", "rtkfawnopq")); - model = BinaryData.fromObject(model).toObject(DaprComponentInner.class); - Assertions.assertEquals("nrojlpijnkr", model.componentType()); - Assertions.assertEquals("rddh", model.version()); - Assertions.assertEquals(false, model.ignoreErrors()); - Assertions.assertEquals("izzronasxiftozqy", model.initTimeout()); - Assertions.assertEquals("wesgogczh", model.secrets().get(0).name()); - Assertions.assertEquals("nxkrlgnyhmossxkk", model.secrets().get(0).value()); - Assertions.assertEquals("h", model.secretStoreComponent()); - Assertions.assertEquals("xjb", model.metadata().get(0).name()); - Assertions.assertEquals("qxvcxgfrpdsofb", model.metadata().get(0).value()); - Assertions.assertEquals("rnsvbuswd", model.metadata().get(0).secretRef()); - Assertions.assertEquals("ybycnunvj", model.scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentPropertiesTests.java deleted file mode 100644 index baea4ceb25bbd..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentPropertiesTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentProperties; -import com.azure.resourcemanager.appcontainers.models.DaprMetadata; -import com.azure.resourcemanager.appcontainers.models.Secret; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DaprComponentPropertiesTests { - @Test - public void testDeserialize() { - DaprComponentProperties model = - BinaryData - .fromString( - "{\"componentType\":\"xtqmieoxor\",\"version\":\"ufhyaomtbgh\",\"ignoreErrors\":false,\"initTimeout\":\"rvk\",\"secrets\":[{\"name\":\"jzhpjbibgjmfx\",\"value\":\"vfcluyovwxnbkfe\"},{\"name\":\"xscyhwzdgirujbz\",\"value\":\"mvzzbtdcqvp\"},{\"name\":\"yujviylwdshfssn\",\"value\":\"gy\"},{\"name\":\"rymsgaojfmw\",\"value\":\"otmrfhir\"}],\"secretStoreComponent\":\"ymoxoftpipiwyczu\",\"metadata\":[{\"name\":\"pqjlihhyusps\",\"value\":\"sdvlmfwdgzxulucv\",\"secretRef\":\"mrsreuzvxurisjnh\"}],\"scopes\":[\"xifqjzgxm\",\"hu\"]}") - .toObject(DaprComponentProperties.class); - Assertions.assertEquals("xtqmieoxor", model.componentType()); - Assertions.assertEquals("ufhyaomtbgh", model.version()); - Assertions.assertEquals(false, model.ignoreErrors()); - Assertions.assertEquals("rvk", model.initTimeout()); - Assertions.assertEquals("jzhpjbibgjmfx", model.secrets().get(0).name()); - Assertions.assertEquals("vfcluyovwxnbkfe", model.secrets().get(0).value()); - Assertions.assertEquals("ymoxoftpipiwyczu", model.secretStoreComponent()); - Assertions.assertEquals("pqjlihhyusps", model.metadata().get(0).name()); - Assertions.assertEquals("sdvlmfwdgzxulucv", model.metadata().get(0).value()); - Assertions.assertEquals("mrsreuzvxurisjnh", model.metadata().get(0).secretRef()); - Assertions.assertEquals("xifqjzgxm", model.scopes().get(0)); - } - - @Test - public void testSerialize() { - DaprComponentProperties model = - new DaprComponentProperties() - .withComponentType("xtqmieoxor") - .withVersion("ufhyaomtbgh") - .withIgnoreErrors(false) - .withInitTimeout("rvk") - .withSecrets( - Arrays - .asList( - new Secret().withName("jzhpjbibgjmfx").withValue("vfcluyovwxnbkfe"), - new Secret().withName("xscyhwzdgirujbz").withValue("mvzzbtdcqvp"), - new Secret().withName("yujviylwdshfssn").withValue("gy"), - new Secret().withName("rymsgaojfmw").withValue("otmrfhir"))) - .withSecretStoreComponent("ymoxoftpipiwyczu") - .withMetadata( - Arrays - .asList( - new DaprMetadata() - .withName("pqjlihhyusps") - .withValue("sdvlmfwdgzxulucv") - .withSecretRef("mrsreuzvxurisjnh"))) - .withScopes(Arrays.asList("xifqjzgxm", "hu")); - model = BinaryData.fromObject(model).toObject(DaprComponentProperties.class); - Assertions.assertEquals("xtqmieoxor", model.componentType()); - Assertions.assertEquals("ufhyaomtbgh", model.version()); - Assertions.assertEquals(false, model.ignoreErrors()); - Assertions.assertEquals("rvk", model.initTimeout()); - Assertions.assertEquals("jzhpjbibgjmfx", model.secrets().get(0).name()); - Assertions.assertEquals("vfcluyovwxnbkfe", model.secrets().get(0).value()); - Assertions.assertEquals("ymoxoftpipiwyczu", model.secretStoreComponent()); - Assertions.assertEquals("pqjlihhyusps", model.metadata().get(0).name()); - Assertions.assertEquals("sdvlmfwdgzxulucv", model.metadata().get(0).value()); - Assertions.assertEquals("mrsreuzvxurisjnh", model.metadata().get(0).secretRef()); - Assertions.assertEquals("xifqjzgxm", model.scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCollectionTests.java deleted file mode 100644 index 95372d8cf1fe1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsCollectionTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprComponentInner; -import com.azure.resourcemanager.appcontainers.models.DaprComponentsCollection; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DaprComponentsCollectionTests { - @Test - public void testDeserialize() { - DaprComponentsCollection model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"componentType\":\"txhojujb\",\"version\":\"elmcuvhixbjxyfw\",\"ignoreErrors\":true,\"initTimeout\":\"coolsttpkiwkkb\",\"secrets\":[],\"secretStoreComponent\":\"rywvtylbfpn\",\"metadata\":[],\"scopes\":[]},\"id\":\"oiwiithtywub\",\"name\":\"cbihwqk\",\"type\":\"fdntwjchrdgoih\"},{\"properties\":{\"componentType\":\"wct\",\"version\":\"dzjlu\",\"ignoreErrors\":false,\"initTimeout\":\"lwg\",\"secrets\":[],\"secretStoreComponent\":\"sb\",\"metadata\":[],\"scopes\":[]},\"id\":\"vtgsei\",\"name\":\"qfi\",\"type\":\"fxqknpirgneptt\"}],\"nextLink\":\"msniffc\"}") - .toObject(DaprComponentsCollection.class); - Assertions.assertEquals("txhojujb", model.value().get(0).componentType()); - Assertions.assertEquals("elmcuvhixbjxyfw", model.value().get(0).version()); - Assertions.assertEquals(true, model.value().get(0).ignoreErrors()); - Assertions.assertEquals("coolsttpkiwkkb", model.value().get(0).initTimeout()); - Assertions.assertEquals("rywvtylbfpn", model.value().get(0).secretStoreComponent()); - } - - @Test - public void testSerialize() { - DaprComponentsCollection model = - new DaprComponentsCollection() - .withValue( - Arrays - .asList( - new DaprComponentInner() - .withComponentType("txhojujb") - .withVersion("elmcuvhixbjxyfw") - .withIgnoreErrors(true) - .withInitTimeout("coolsttpkiwkkb") - .withSecrets(Arrays.asList()) - .withSecretStoreComponent("rywvtylbfpn") - .withMetadata(Arrays.asList()) - .withScopes(Arrays.asList()), - new DaprComponentInner() - .withComponentType("wct") - .withVersion("dzjlu") - .withIgnoreErrors(false) - .withInitTimeout("lwg") - .withSecrets(Arrays.asList()) - .withSecretStoreComponent("sb") - .withMetadata(Arrays.asList()) - .withScopes(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(DaprComponentsCollection.class); - Assertions.assertEquals("txhojujb", model.value().get(0).componentType()); - Assertions.assertEquals("elmcuvhixbjxyfw", model.value().get(0).version()); - Assertions.assertEquals(true, model.value().get(0).ignoreErrors()); - Assertions.assertEquals("coolsttpkiwkkb", model.value().get(0).initTimeout()); - Assertions.assertEquals("rywvtylbfpn", model.value().get(0).secretStoreComponent()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListMockTests.java deleted file mode 100644 index 9c6865d077de9..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprComponentsListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.DaprComponent; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DaprComponentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"componentType\":\"ccsrmozihmipgaw\",\"version\":\"xp\",\"ignoreErrors\":true,\"initTimeout\":\"xcjxgrytfmpcy\",\"secrets\":[],\"secretStoreComponent\":\"mcayk\",\"metadata\":[],\"scopes\":[\"uztrksxwpndfcpf\"]},\"id\":\"nthjtwkjaosrxuzv\",\"name\":\"amktcqiosmgbzah\",\"type\":\"xqdlyrtltlapr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.daprComponents().list("atftgzpnpbsw", "e", Context.NONE); - - Assertions.assertEquals("ccsrmozihmipgaw", response.iterator().next().componentType()); - Assertions.assertEquals("xp", response.iterator().next().version()); - Assertions.assertEquals(true, response.iterator().next().ignoreErrors()); - Assertions.assertEquals("xcjxgrytfmpcy", response.iterator().next().initTimeout()); - Assertions.assertEquals("mcayk", response.iterator().next().secretStoreComponent()); - Assertions.assertEquals("uztrksxwpndfcpf", response.iterator().next().scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprMetadataTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprMetadataTests.java deleted file mode 100644 index c832a2f40fc34..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprMetadataTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DaprMetadata; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DaprMetadataTests { - @Test - public void testDeserialize() { - DaprMetadata model = - BinaryData - .fromString("{\"name\":\"wp\",\"value\":\"sutrgjup\",\"secretRef\":\"utpwoqhihejqgw\"}") - .toObject(DaprMetadata.class); - Assertions.assertEquals("wp", model.name()); - Assertions.assertEquals("sutrgjup", model.value()); - Assertions.assertEquals("utpwoqhihejqgw", model.secretRef()); - } - - @Test - public void testSerialize() { - DaprMetadata model = new DaprMetadata().withName("wp").withValue("sutrgjup").withSecretRef("utpwoqhihejqgw"); - model = BinaryData.fromObject(model).toObject(DaprMetadata.class); - Assertions.assertEquals("wp", model.name()); - Assertions.assertEquals("sutrgjup", model.value()); - Assertions.assertEquals("utpwoqhihejqgw", model.secretRef()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretsCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretsCollectionInnerTests.java deleted file mode 100644 index ebe4e04a66a85..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprSecretsCollectionInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DaprSecretsCollectionInner; -import com.azure.resourcemanager.appcontainers.models.Secret; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DaprSecretsCollectionInnerTests { - @Test - public void testDeserialize() { - DaprSecretsCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"fqntcyp\",\"value\":\"jv\"},{\"name\":\"imwkslircizj\",\"value\":\"ydfce\"},{\"name\":\"vlhv\",\"value\":\"dyftumrtwna\"}]}") - .toObject(DaprSecretsCollectionInner.class); - Assertions.assertEquals("fqntcyp", model.value().get(0).name()); - Assertions.assertEquals("jv", model.value().get(0).value()); - } - - @Test - public void testSerialize() { - DaprSecretsCollectionInner model = - new DaprSecretsCollectionInner() - .withValue( - Arrays - .asList( - new Secret().withName("fqntcyp").withValue("jv"), - new Secret().withName("imwkslircizj").withValue("ydfce"), - new Secret().withName("vlhv").withValue("dyftumrtwna"))); - model = BinaryData.fromObject(model).toObject(DaprSecretsCollectionInner.class); - Assertions.assertEquals("fqntcyp", model.value().get(0).name()); - Assertions.assertEquals("jv", model.value().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprTests.java deleted file mode 100644 index 3b8027a54a9b1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DaprTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AppProtocol; -import com.azure.resourcemanager.appcontainers.models.Dapr; -import com.azure.resourcemanager.appcontainers.models.LogLevel; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DaprTests { - @Test - public void testDeserialize() { - Dapr model = - BinaryData - .fromString( - "{\"enabled\":true,\"appId\":\"prwmdyvxqt\",\"appProtocol\":\"http\",\"appPort\":357638492,\"httpReadBufferSize\":438099264,\"httpMaxRequestSize\":1692678524,\"logLevel\":\"debug\",\"enableApiLogging\":true}") - .toObject(Dapr.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("prwmdyvxqt", model.appId()); - Assertions.assertEquals(AppProtocol.HTTP, model.appProtocol()); - Assertions.assertEquals(357638492, model.appPort()); - Assertions.assertEquals(438099264, model.httpReadBufferSize()); - Assertions.assertEquals(1692678524, model.httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.DEBUG, model.logLevel()); - Assertions.assertEquals(true, model.enableApiLogging()); - } - - @Test - public void testSerialize() { - Dapr model = - new Dapr() - .withEnabled(true) - .withAppId("prwmdyvxqt") - .withAppProtocol(AppProtocol.HTTP) - .withAppPort(357638492) - .withHttpReadBufferSize(438099264) - .withHttpMaxRequestSize(1692678524) - .withLogLevel(LogLevel.DEBUG) - .withEnableApiLogging(true); - model = BinaryData.fromObject(model).toObject(Dapr.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("prwmdyvxqt", model.appId()); - Assertions.assertEquals(AppProtocol.HTTP, model.appProtocol()); - Assertions.assertEquals(357638492, model.appPort()); - Assertions.assertEquals(438099264, model.httpReadBufferSize()); - Assertions.assertEquals(1692678524, model.httpMaxRequestSize()); - Assertions.assertEquals(LogLevel.DEBUG, model.logLevel()); - Assertions.assertEquals(true, model.enableApiLogging()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultAuthorizationPolicyTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultAuthorizationPolicyTests.java deleted file mode 100644 index 5df6832f94830..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultAuthorizationPolicyTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedPrincipals; -import com.azure.resourcemanager.appcontainers.models.DefaultAuthorizationPolicy; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DefaultAuthorizationPolicyTests { - @Test - public void testDeserialize() { - DefaultAuthorizationPolicy model = - BinaryData - .fromString( - "{\"allowedPrincipals\":{\"groups\":[\"nohjt\"],\"identities\":[\"h\",\"soifiyipjxsqw\",\"gr\"]},\"allowedApplications\":[\"norcjxvsnbyxqab\",\"mocpc\"]}") - .toObject(DefaultAuthorizationPolicy.class); - Assertions.assertEquals("nohjt", model.allowedPrincipals().groups().get(0)); - Assertions.assertEquals("h", model.allowedPrincipals().identities().get(0)); - Assertions.assertEquals("norcjxvsnbyxqab", model.allowedApplications().get(0)); - } - - @Test - public void testSerialize() { - DefaultAuthorizationPolicy model = - new DefaultAuthorizationPolicy() - .withAllowedPrincipals( - new AllowedPrincipals() - .withGroups(Arrays.asList("nohjt")) - .withIdentities(Arrays.asList("h", "soifiyipjxsqw", "gr"))) - .withAllowedApplications(Arrays.asList("norcjxvsnbyxqab", "mocpc")); - model = BinaryData.fromObject(model).toObject(DefaultAuthorizationPolicy.class); - Assertions.assertEquals("nohjt", model.allowedPrincipals().groups().get(0)); - Assertions.assertEquals("h", model.allowedPrincipals().identities().get(0)); - Assertions.assertEquals("norcjxvsnbyxqab", model.allowedApplications().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultErrorResponseErrorTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultErrorResponseErrorTests.java deleted file mode 100644 index 95594f2e8c2a4..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DefaultErrorResponseErrorTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseError; -import org.junit.jupiter.api.Test; - -public final class DefaultErrorResponseErrorTests { - @Test - public void testDeserialize() { - DefaultErrorResponseError model = - BinaryData.fromString("{\"innererror\":\"ofqweykhmenevfye\"}").toObject(DefaultErrorResponseError.class); - } - - @Test - public void testSerialize() { - DefaultErrorResponseError model = new DefaultErrorResponseError(); - model = BinaryData.fromObject(model).toObject(DefaultErrorResponseError.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataPropertyBagItemTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataPropertyBagItemTests.java deleted file mode 100644 index 1ff9c37260cb1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataPropertyBagItemTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticDataProviderMetadataPropertyBagItemTests { - @Test - public void testDeserialize() { - DiagnosticDataProviderMetadataPropertyBagItem model = - BinaryData - .fromString("{\"name\":\"egfnmntfpmvmemfn\",\"value\":\"dwvvba\"}") - .toObject(DiagnosticDataProviderMetadataPropertyBagItem.class); - Assertions.assertEquals("egfnmntfpmvmemfn", model.name()); - Assertions.assertEquals("dwvvba", model.value()); - } - - @Test - public void testSerialize() { - DiagnosticDataProviderMetadataPropertyBagItem model = - new DiagnosticDataProviderMetadataPropertyBagItem().withName("egfnmntfpmvmemfn").withValue("dwvvba"); - model = BinaryData.fromObject(model).toObject(DiagnosticDataProviderMetadataPropertyBagItem.class); - Assertions.assertEquals("egfnmntfpmvmemfn", model.name()); - Assertions.assertEquals("dwvvba", model.value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataTests.java deleted file mode 100644 index 6296fe1163cc1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataProviderMetadataTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticDataProviderMetadataTests { - @Test - public void testDeserialize() { - DiagnosticDataProviderMetadata model = - BinaryData - .fromString( - "{\"providerName\":\"kkudzp\",\"propertyBag\":[{\"name\":\"plmag\",\"value\":\"cyohpfkyrkdbd\"},{\"name\":\"ogsjkmnwqjno\",\"value\":\"iyhddvi\"}]}") - .toObject(DiagnosticDataProviderMetadata.class); - Assertions.assertEquals("kkudzp", model.providerName()); - Assertions.assertEquals("plmag", model.propertyBag().get(0).name()); - Assertions.assertEquals("cyohpfkyrkdbd", model.propertyBag().get(0).value()); - } - - @Test - public void testSerialize() { - DiagnosticDataProviderMetadata model = - new DiagnosticDataProviderMetadata() - .withProviderName("kkudzp") - .withPropertyBag( - Arrays - .asList( - new DiagnosticDataProviderMetadataPropertyBagItem() - .withName("plmag") - .withValue("cyohpfkyrkdbd"), - new DiagnosticDataProviderMetadataPropertyBagItem() - .withName("ogsjkmnwqjno") - .withValue("iyhddvi"))); - model = BinaryData.fromObject(model).toObject(DiagnosticDataProviderMetadata.class); - Assertions.assertEquals("kkudzp", model.providerName()); - Assertions.assertEquals("plmag", model.propertyBag().get(0).name()); - Assertions.assertEquals("cyohpfkyrkdbd", model.propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseColumnTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseColumnTests.java deleted file mode 100644 index 495097569ebc0..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseColumnTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticDataTableResponseColumnTests { - @Test - public void testDeserialize() { - DiagnosticDataTableResponseColumn model = - BinaryData - .fromString("{\"columnName\":\"orbteoy\",\"dataType\":\"hjxa\",\"columnType\":\"vjgsl\"}") - .toObject(DiagnosticDataTableResponseColumn.class); - Assertions.assertEquals("orbteoy", model.columnName()); - Assertions.assertEquals("hjxa", model.dataType()); - Assertions.assertEquals("vjgsl", model.columnType()); - } - - @Test - public void testSerialize() { - DiagnosticDataTableResponseColumn model = - new DiagnosticDataTableResponseColumn() - .withColumnName("orbteoy") - .withDataType("hjxa") - .withColumnType("vjgsl"); - model = BinaryData.fromObject(model).toObject(DiagnosticDataTableResponseColumn.class); - Assertions.assertEquals("orbteoy", model.columnName()); - Assertions.assertEquals("hjxa", model.dataType()); - Assertions.assertEquals("vjgsl", model.columnType()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseObjectTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseObjectTests.java deleted file mode 100644 index 2b8439a752ceb..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticDataTableResponseObjectTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticDataTableResponseObjectTests { - @Test - public void testDeserialize() { - DiagnosticDataTableResponseObject model = - BinaryData - .fromString( - "{\"tableName\":\"xkcgxxlxsffgcvi\",\"columns\":[{\"columnName\":\"wlvwlyoupf\",\"dataType\":\"bkjubdyhgkfmins\",\"columnType\":\"wzf\"},{\"columnName\":\"sttktlahbqa\",\"dataType\":\"xtgzukxitmmqtgqq\",\"columnType\":\"hrnxrxc\"},{\"columnName\":\"uisavokq\",\"dataType\":\"fvazivjlfrqttba\",\"columnType\":\"katnwxyi\"},{\"columnName\":\"id\",\"dataType\":\"qfkuvscxkdmli\",\"columnType\":\"vibrxkpmloazuruo\"}],\"rows\":[]}") - .toObject(DiagnosticDataTableResponseObject.class); - Assertions.assertEquals("xkcgxxlxsffgcvi", model.tableName()); - Assertions.assertEquals("wlvwlyoupf", model.columns().get(0).columnName()); - Assertions.assertEquals("bkjubdyhgkfmins", model.columns().get(0).dataType()); - Assertions.assertEquals("wzf", model.columns().get(0).columnType()); - } - - @Test - public void testSerialize() { - DiagnosticDataTableResponseObject model = - new DiagnosticDataTableResponseObject() - .withTableName("xkcgxxlxsffgcvi") - .withColumns( - Arrays - .asList( - new DiagnosticDataTableResponseColumn() - .withColumnName("wlvwlyoupf") - .withDataType("bkjubdyhgkfmins") - .withColumnType("wzf"), - new DiagnosticDataTableResponseColumn() - .withColumnName("sttktlahbqa") - .withDataType("xtgzukxitmmqtgqq") - .withColumnType("hrnxrxc"), - new DiagnosticDataTableResponseColumn() - .withColumnName("uisavokq") - .withDataType("fvazivjlfrqttba") - .withColumnType("katnwxyi"), - new DiagnosticDataTableResponseColumn() - .withColumnName("id") - .withDataType("qfkuvscxkdmli") - .withColumnType("vibrxkpmloazuruo"))) - .withRows(Arrays.asList()); - model = BinaryData.fromObject(model).toObject(DiagnosticDataTableResponseObject.class); - Assertions.assertEquals("xkcgxxlxsffgcvi", model.tableName()); - Assertions.assertEquals("wlvwlyoupf", model.columns().get(0).columnName()); - Assertions.assertEquals("bkjubdyhgkfmins", model.columns().get(0).dataType()); - Assertions.assertEquals("wzf", model.columns().get(0).columnType()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticRenderingTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticRenderingTests.java deleted file mode 100644 index 57e77db319d42..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticRenderingTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticRenderingTests { - @Test - public void testDeserialize() { - DiagnosticRendering model = - BinaryData - .fromString( - "{\"type\":1644045294,\"title\":\"lmywwtkgkxnyed\",\"description\":\"gyvudtjuewbc\",\"isVisible\":false}") - .toObject(DiagnosticRendering.class); - Assertions.assertEquals(1644045294, model.type()); - Assertions.assertEquals("lmywwtkgkxnyed", model.title()); - Assertions.assertEquals("gyvudtjuewbc", model.description()); - Assertions.assertEquals(false, model.isVisible()); - } - - @Test - public void testSerialize() { - DiagnosticRendering model = - new DiagnosticRendering() - .withType(1644045294) - .withTitle("lmywwtkgkxnyed") - .withDescription("gyvudtjuewbc") - .withIsVisible(false); - model = BinaryData.fromObject(model).toObject(DiagnosticRendering.class); - Assertions.assertEquals(1644045294, model.type()); - Assertions.assertEquals("lmywwtkgkxnyed", model.title()); - Assertions.assertEquals("gyvudtjuewbc", model.description()); - Assertions.assertEquals(false, model.isVisible()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticSupportTopicTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticSupportTopicTests.java deleted file mode 100644 index cc714f85b1c3f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticSupportTopicTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import org.junit.jupiter.api.Test; - -public final class DiagnosticSupportTopicTests { - @Test - public void testDeserialize() { - DiagnosticSupportTopic model = - BinaryData - .fromString("{\"id\":\"wjhhgdnhxmsivf\",\"pesId\":\"iloxggdufiq\"}") - .toObject(DiagnosticSupportTopic.class); - } - - @Test - public void testSerialize() { - DiagnosticSupportTopic model = new DiagnosticSupportTopic(); - model = BinaryData.fromObject(model).toObject(DiagnosticSupportTopic.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsCollectionInnerTests.java deleted file mode 100644 index 7a2a5be7570a9..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsCollectionInnerTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsCollectionInner; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class DiagnosticsCollectionInnerTests { - @Test - public void testDeserialize() { - DiagnosticsCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"dataset\":[]},\"id\":\"ojgcyzt\",\"name\":\"fmznba\",\"type\":\"qphchqnrnrpxehuw\"}],\"nextLink\":\"k\"}") - .toObject(DiagnosticsCollectionInner.class); - } - - @Test - public void testSerialize() { - DiagnosticsCollectionInner model = - new DiagnosticsCollectionInner() - .withValue( - Arrays - .asList( - new DiagnosticsInner() - .withProperties(new DiagnosticsProperties().withDataset(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(DiagnosticsCollectionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDataApiResponseTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDataApiResponseTests.java deleted file mode 100644 index 04a2ef5693cdd..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDataApiResponseTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseColumn; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticsDataApiResponseTests { - @Test - public void testDeserialize() { - DiagnosticsDataApiResponse model = - BinaryData - .fromString( - "{\"table\":{\"tableName\":\"euzaof\",\"columns\":[{\"columnName\":\"cyyysfgdot\",\"dataType\":\"biipuip\",\"columnType\":\"qonmacj\"},{\"columnName\":\"nizshqvcim\",\"dataType\":\"vfgmblrrilby\",\"columnType\":\"xsmiccwrwfscjf\"},{\"columnName\":\"nszqujiz\",\"dataType\":\"oqytibyowbblgy\",\"columnType\":\"utp\"}],\"rows\":[]},\"renderingProperties\":{\"type\":1814921702,\"title\":\"smsks\",\"description\":\"iml\",\"isVisible\":true}}") - .toObject(DiagnosticsDataApiResponse.class); - Assertions.assertEquals("euzaof", model.table().tableName()); - Assertions.assertEquals("cyyysfgdot", model.table().columns().get(0).columnName()); - Assertions.assertEquals("biipuip", model.table().columns().get(0).dataType()); - Assertions.assertEquals("qonmacj", model.table().columns().get(0).columnType()); - Assertions.assertEquals(1814921702, model.renderingProperties().type()); - Assertions.assertEquals("smsks", model.renderingProperties().title()); - Assertions.assertEquals("iml", model.renderingProperties().description()); - Assertions.assertEquals(true, model.renderingProperties().isVisible()); - } - - @Test - public void testSerialize() { - DiagnosticsDataApiResponse model = - new DiagnosticsDataApiResponse() - .withTable( - new DiagnosticDataTableResponseObject() - .withTableName("euzaof") - .withColumns( - Arrays - .asList( - new DiagnosticDataTableResponseColumn() - .withColumnName("cyyysfgdot") - .withDataType("biipuip") - .withColumnType("qonmacj"), - new DiagnosticDataTableResponseColumn() - .withColumnName("nizshqvcim") - .withDataType("vfgmblrrilby") - .withColumnType("xsmiccwrwfscjf"), - new DiagnosticDataTableResponseColumn() - .withColumnName("nszqujiz") - .withDataType("oqytibyowbblgy") - .withColumnType("utp"))) - .withRows(Arrays.asList())) - .withRenderingProperties( - new DiagnosticRendering() - .withType(1814921702) - .withTitle("smsks") - .withDescription("iml") - .withIsVisible(true)); - model = BinaryData.fromObject(model).toObject(DiagnosticsDataApiResponse.class); - Assertions.assertEquals("euzaof", model.table().tableName()); - Assertions.assertEquals("cyyysfgdot", model.table().columns().get(0).columnName()); - Assertions.assertEquals("biipuip", model.table().columns().get(0).dataType()); - Assertions.assertEquals("qonmacj", model.table().columns().get(0).columnType()); - Assertions.assertEquals(1814921702, model.renderingProperties().type()); - Assertions.assertEquals("smsks", model.renderingProperties().title()); - Assertions.assertEquals("iml", model.renderingProperties().description()); - Assertions.assertEquals(true, model.renderingProperties().isVisible()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDefinitionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDefinitionTests.java deleted file mode 100644 index bc2f584110f85..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsDefinitionTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticsDefinitionTests { - @Test - public void testDeserialize() { - DiagnosticsDefinition model = - BinaryData - .fromString( - "{\"id\":\"wmd\",\"name\":\"wpklvxw\",\"description\":\"gdxpg\",\"author\":\"chisze\",\"category\":\"nb\",\"supportTopicList\":[{\"id\":\"gibbdaxc\",\"pesId\":\"fozauorsuk\"},{\"id\":\"wbqpl\",\"pesId\":\"vnuuepzl\"}],\"analysisTypes\":[\"wzsoldweyuqdunv\"],\"type\":\"nrwrbiork\",\"score\":33.805977}") - .toObject(DiagnosticsDefinition.class); - Assertions.assertEquals("wzsoldweyuqdunv", model.analysisTypes().get(0)); - } - - @Test - public void testSerialize() { - DiagnosticsDefinition model = - new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("wzsoldweyuqdunv")); - model = BinaryData.fromObject(model).toObject(DiagnosticsDefinition.class); - Assertions.assertEquals("wzsoldweyuqdunv", model.analysisTypes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsInnerTests.java deleted file mode 100644 index f69f93b1b0948..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsInnerTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.DiagnosticsInner; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsProperties; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticsInnerTests { - @Test - public void testDeserialize() { - DiagnosticsInner model = - BinaryData - .fromString( - "{\"properties\":{\"metadata\":{\"id\":\"fmviklby\",\"name\":\"khbejdznxc\",\"description\":\"srhnjivo\",\"author\":\"tnovqfzgemjdftul\",\"category\":\"tduceamt\",\"supportTopicList\":[],\"analysisTypes\":[\"m\"],\"type\":\"wcw\",\"score\":57.057808},\"dataset\":[{},{},{}],\"status\":{\"message\":\"sv\",\"statusId\":750225964},\"dataProviderMetadata\":{\"providerName\":\"vk\",\"propertyBag\":[]}},\"id\":\"ql\",\"name\":\"yxgtczh\",\"type\":\"ydbsd\"}") - .toObject(DiagnosticsInner.class); - Assertions.assertEquals("m", model.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("sv", model.properties().status().message()); - Assertions.assertEquals(750225964, model.properties().status().statusId()); - Assertions.assertEquals("vk", model.properties().dataProviderMetadata().providerName()); - } - - @Test - public void testSerialize() { - DiagnosticsInner model = - new DiagnosticsInner() - .withProperties( - new DiagnosticsProperties() - .withMetadata( - new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList()) - .withAnalysisTypes(Arrays.asList("m"))) - .withDataset( - Arrays - .asList( - new DiagnosticsDataApiResponse(), - new DiagnosticsDataApiResponse(), - new DiagnosticsDataApiResponse())) - .withStatus(new DiagnosticsStatus().withMessage("sv").withStatusId(750225964)) - .withDataProviderMetadata( - new DiagnosticDataProviderMetadata() - .withProviderName("vk") - .withPropertyBag(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(DiagnosticsInner.class); - Assertions.assertEquals("m", model.properties().metadata().analysisTypes().get(0)); - Assertions.assertEquals("sv", model.properties().status().message()); - Assertions.assertEquals(750225964, model.properties().status().statusId()); - Assertions.assertEquals("vk", model.properties().dataProviderMetadata().providerName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsPropertiesTests.java deleted file mode 100644 index ead64e3b0d1a0..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsPropertiesTests.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadata; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataProviderMetadataPropertyBagItem; -import com.azure.resourcemanager.appcontainers.models.DiagnosticDataTableResponseObject; -import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering; -import com.azure.resourcemanager.appcontainers.models.DiagnosticSupportTopic; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDataApiResponse; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsDefinition; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsProperties; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticsPropertiesTests { - @Test - public void testDeserialize() { - DiagnosticsProperties model = - BinaryData - .fromString( - "{\"metadata\":{\"id\":\"kx\",\"name\":\"ehvbbxurip\",\"description\":\"fnhtbaxkgxyw\",\"author\":\"kpyklyhp\",\"category\":\"odpvruudlgzib\",\"supportTopicList\":[{\"id\":\"tgk\",\"pesId\":\"tvdxeclzedqb\"},{\"id\":\"hzlhplodqkdlww\",\"pesId\":\"bum\"}],\"analysisTypes\":[\"trqjfsmlmbtx\",\"w\"],\"type\":\"wsrt\",\"score\":70.81028},\"dataset\":[{\"table\":{\"tableName\":\"rhubskhud\",\"columns\":[],\"rows\":[]},\"renderingProperties\":{\"type\":328293320,\"title\":\"qfqjbvleorfm\",\"description\":\"iqtqzfavyvnq\",\"isVisible\":false}},{\"table\":{\"tableName\":\"yeua\",\"columns\":[],\"rows\":[]},\"renderingProperties\":{\"type\":1625919856,\"title\":\"gzslesjcbhernnti\",\"description\":\"djc\",\"isVisible\":true}},{\"table\":{\"tableName\":\"rbe\",\"columns\":[],\"rows\":[]},\"renderingProperties\":{\"type\":52673301,\"title\":\"uffkmrqemvvh\",\"description\":\"tdrjfutacoebj\",\"isVisible\":true}}],\"status\":{\"message\":\"jznmwcpmguaa\",\"statusId\":1984994243},\"dataProviderMetadata\":{\"providerName\":\"actkahzovajj\",\"propertyBag\":[{\"name\":\"xps\",\"value\":\"eekulfgslqubkwd\"},{\"name\":\"nrdsutujbazpjuoh\",\"value\":\"nyfln\"}]}}") - .toObject(DiagnosticsProperties.class); - Assertions.assertEquals("trqjfsmlmbtx", model.metadata().analysisTypes().get(0)); - Assertions.assertEquals("rhubskhud", model.dataset().get(0).table().tableName()); - Assertions.assertEquals(328293320, model.dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("qfqjbvleorfm", model.dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("iqtqzfavyvnq", model.dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, model.dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("jznmwcpmguaa", model.status().message()); - Assertions.assertEquals(1984994243, model.status().statusId()); - Assertions.assertEquals("actkahzovajj", model.dataProviderMetadata().providerName()); - Assertions.assertEquals("xps", model.dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("eekulfgslqubkwd", model.dataProviderMetadata().propertyBag().get(0).value()); - } - - @Test - public void testSerialize() { - DiagnosticsProperties model = - new DiagnosticsProperties() - .withMetadata( - new DiagnosticsDefinition() - .withSupportTopicList(Arrays.asList(new DiagnosticSupportTopic(), new DiagnosticSupportTopic())) - .withAnalysisTypes(Arrays.asList("trqjfsmlmbtx", "w"))) - .withDataset( - Arrays - .asList( - new DiagnosticsDataApiResponse() - .withTable( - new DiagnosticDataTableResponseObject() - .withTableName("rhubskhud") - .withColumns(Arrays.asList()) - .withRows(Arrays.asList())) - .withRenderingProperties( - new DiagnosticRendering() - .withType(328293320) - .withTitle("qfqjbvleorfm") - .withDescription("iqtqzfavyvnq") - .withIsVisible(false)), - new DiagnosticsDataApiResponse() - .withTable( - new DiagnosticDataTableResponseObject() - .withTableName("yeua") - .withColumns(Arrays.asList()) - .withRows(Arrays.asList())) - .withRenderingProperties( - new DiagnosticRendering() - .withType(1625919856) - .withTitle("gzslesjcbhernnti") - .withDescription("djc") - .withIsVisible(true)), - new DiagnosticsDataApiResponse() - .withTable( - new DiagnosticDataTableResponseObject() - .withTableName("rbe") - .withColumns(Arrays.asList()) - .withRows(Arrays.asList())) - .withRenderingProperties( - new DiagnosticRendering() - .withType(52673301) - .withTitle("uffkmrqemvvh") - .withDescription("tdrjfutacoebj") - .withIsVisible(true)))) - .withStatus(new DiagnosticsStatus().withMessage("jznmwcpmguaa").withStatusId(1984994243)) - .withDataProviderMetadata( - new DiagnosticDataProviderMetadata() - .withProviderName("actkahzovajj") - .withPropertyBag( - Arrays - .asList( - new DiagnosticDataProviderMetadataPropertyBagItem() - .withName("xps") - .withValue("eekulfgslqubkwd"), - new DiagnosticDataProviderMetadataPropertyBagItem() - .withName("nrdsutujbazpjuoh") - .withValue("nyfln")))); - model = BinaryData.fromObject(model).toObject(DiagnosticsProperties.class); - Assertions.assertEquals("trqjfsmlmbtx", model.metadata().analysisTypes().get(0)); - Assertions.assertEquals("rhubskhud", model.dataset().get(0).table().tableName()); - Assertions.assertEquals(328293320, model.dataset().get(0).renderingProperties().type()); - Assertions.assertEquals("qfqjbvleorfm", model.dataset().get(0).renderingProperties().title()); - Assertions.assertEquals("iqtqzfavyvnq", model.dataset().get(0).renderingProperties().description()); - Assertions.assertEquals(false, model.dataset().get(0).renderingProperties().isVisible()); - Assertions.assertEquals("jznmwcpmguaa", model.status().message()); - Assertions.assertEquals(1984994243, model.status().statusId()); - Assertions.assertEquals("actkahzovajj", model.dataProviderMetadata().providerName()); - Assertions.assertEquals("xps", model.dataProviderMetadata().propertyBag().get(0).name()); - Assertions.assertEquals("eekulfgslqubkwd", model.dataProviderMetadata().propertyBag().get(0).value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsStatusTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsStatusTests.java deleted file mode 100644 index f99b750e5ba03..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/DiagnosticsStatusTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.DiagnosticsStatus; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class DiagnosticsStatusTests { - @Test - public void testDeserialize() { - DiagnosticsStatus model = - BinaryData - .fromString("{\"message\":\"uwhcjyxccybv\",\"statusId\":940165825}") - .toObject(DiagnosticsStatus.class); - Assertions.assertEquals("uwhcjyxccybv", model.message()); - Assertions.assertEquals(940165825, model.statusId()); - } - - @Test - public void testSerialize() { - DiagnosticsStatus model = new DiagnosticsStatus().withMessage("uwhcjyxccybv").withStatusId(940165825); - model = BinaryData.fromObject(model).toObject(DiagnosticsStatus.class); - Assertions.assertEquals("uwhcjyxccybv", model.message()); - Assertions.assertEquals(940165825, model.statusId()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/EnvironmentSkuPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/EnvironmentSkuPropertiesTests.java deleted file mode 100644 index 20e81e02a3b1d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/EnvironmentSkuPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.EnvironmentSkuProperties; -import com.azure.resourcemanager.appcontainers.models.SkuName; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class EnvironmentSkuPropertiesTests { - @Test - public void testDeserialize() { - EnvironmentSkuProperties model = - BinaryData.fromString("{\"name\":\"Consumption\"}").toObject(EnvironmentSkuProperties.class); - Assertions.assertEquals(SkuName.CONSUMPTION, model.name()); - } - - @Test - public void testSerialize() { - EnvironmentSkuProperties model = new EnvironmentSkuProperties().withName(SkuName.CONSUMPTION); - model = BinaryData.fromObject(model).toObject(EnvironmentSkuProperties.class); - Assertions.assertEquals(SkuName.CONSUMPTION, model.name()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/EnvironmentVarTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/EnvironmentVarTests.java deleted file mode 100644 index c3a507f7eeb20..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/EnvironmentVarTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class EnvironmentVarTests { - @Test - public void testDeserialize() { - EnvironmentVar model = - BinaryData - .fromString("{\"name\":\"washr\",\"value\":\"tkcnqxwb\",\"secretRef\":\"kulpiujwaasi\"}") - .toObject(EnvironmentVar.class); - Assertions.assertEquals("washr", model.name()); - Assertions.assertEquals("tkcnqxwb", model.value()); - Assertions.assertEquals("kulpiujwaasi", model.secretRef()); - } - - @Test - public void testSerialize() { - EnvironmentVar model = - new EnvironmentVar().withName("washr").withValue("tkcnqxwb").withSecretRef("kulpiujwaasi"); - model = BinaryData.fromObject(model).toObject(EnvironmentVar.class); - Assertions.assertEquals("washr", model.name()); - Assertions.assertEquals("tkcnqxwb", model.value()); - Assertions.assertEquals("kulpiujwaasi", model.secretRef()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ExtendedLocationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ExtendedLocationTests.java deleted file mode 100644 index e6683542350b8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ExtendedLocationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocation; -import com.azure.resourcemanager.appcontainers.models.ExtendedLocationTypes; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ExtendedLocationTests { - @Test - public void testDeserialize() { - ExtendedLocation model = - BinaryData - .fromString("{\"name\":\"wrmjmwvvjektc\",\"type\":\"CustomLocation\"}") - .toObject(ExtendedLocation.class); - Assertions.assertEquals("wrmjmwvvjektc", model.name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); - } - - @Test - public void testSerialize() { - ExtendedLocation model = - new ExtendedLocation().withName("wrmjmwvvjektc").withType(ExtendedLocationTypes.CUSTOM_LOCATION); - model = BinaryData.fromObject(model).toObject(ExtendedLocation.class); - Assertions.assertEquals("wrmjmwvvjektc", model.name()); - Assertions.assertEquals(ExtendedLocationTypes.CUSTOM_LOCATION, model.type()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/FacebookTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/FacebookTests.java deleted file mode 100644 index 42ca4bdea2c14..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/FacebookTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AppRegistration; -import com.azure.resourcemanager.appcontainers.models.Facebook; -import com.azure.resourcemanager.appcontainers.models.LoginScopes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class FacebookTests { - @Test - public void testDeserialize() { - Facebook model = - BinaryData - .fromString( - "{\"enabled\":false,\"registration\":{\"appId\":\"yulpkudjkr\",\"appSecretSettingName\":\"hbzhfepg\"},\"graphApiVersion\":\"qex\",\"login\":{\"scopes\":[\"xscpaierhhbc\"]}}") - .toObject(Facebook.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("yulpkudjkr", model.registration().appId()); - Assertions.assertEquals("hbzhfepg", model.registration().appSecretSettingName()); - Assertions.assertEquals("qex", model.graphApiVersion()); - Assertions.assertEquals("xscpaierhhbc", model.login().scopes().get(0)); - } - - @Test - public void testSerialize() { - Facebook model = - new Facebook() - .withEnabled(false) - .withRegistration(new AppRegistration().withAppId("yulpkudjkr").withAppSecretSettingName("hbzhfepg")) - .withGraphApiVersion("qex") - .withLogin(new LoginScopes().withScopes(Arrays.asList("xscpaierhhbc"))); - model = BinaryData.fromObject(model).toObject(Facebook.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("yulpkudjkr", model.registration().appId()); - Assertions.assertEquals("hbzhfepg", model.registration().appSecretSettingName()); - Assertions.assertEquals("qex", model.graphApiVersion()); - Assertions.assertEquals("xscpaierhhbc", model.login().scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ForwardProxyTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ForwardProxyTests.java deleted file mode 100644 index 34afcea8f5c42..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ForwardProxyTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ForwardProxy; -import com.azure.resourcemanager.appcontainers.models.ForwardProxyConvention; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ForwardProxyTests { - @Test - public void testDeserialize() { - ForwardProxy model = - BinaryData - .fromString( - "{\"convention\":\"Custom\",\"customHostHeaderName\":\"jdyggdtji\",\"customProtoHeaderName\":\"b\"}") - .toObject(ForwardProxy.class); - Assertions.assertEquals(ForwardProxyConvention.CUSTOM, model.convention()); - Assertions.assertEquals("jdyggdtji", model.customHostHeaderName()); - Assertions.assertEquals("b", model.customProtoHeaderName()); - } - - @Test - public void testSerialize() { - ForwardProxy model = - new ForwardProxy() - .withConvention(ForwardProxyConvention.CUSTOM) - .withCustomHostHeaderName("jdyggdtji") - .withCustomProtoHeaderName("b"); - model = BinaryData.fromObject(model).toObject(ForwardProxy.class); - Assertions.assertEquals(ForwardProxyConvention.CUSTOM, model.convention()); - Assertions.assertEquals("jdyggdtji", model.customHostHeaderName()); - Assertions.assertEquals("b", model.customProtoHeaderName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GitHubTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GitHubTests.java deleted file mode 100644 index f8ffb579c3cbb..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GitHubTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ClientRegistration; -import com.azure.resourcemanager.appcontainers.models.GitHub; -import com.azure.resourcemanager.appcontainers.models.LoginScopes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class GitHubTests { - @Test - public void testDeserialize() { - GitHub model = - BinaryData - .fromString( - "{\"enabled\":true,\"registration\":{\"clientId\":\"mvdjwzrlovmc\",\"clientSecretSettingName\":\"hijco\"},\"login\":{\"scopes\":[\"bzaqsqsycbkbfk\",\"ukdkexxppofmxa\",\"c\",\"jpgd\"]}}") - .toObject(GitHub.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("mvdjwzrlovmc", model.registration().clientId()); - Assertions.assertEquals("hijco", model.registration().clientSecretSettingName()); - Assertions.assertEquals("bzaqsqsycbkbfk", model.login().scopes().get(0)); - } - - @Test - public void testSerialize() { - GitHub model = - new GitHub() - .withEnabled(true) - .withRegistration( - new ClientRegistration().withClientId("mvdjwzrlovmc").withClientSecretSettingName("hijco")) - .withLogin( - new LoginScopes().withScopes(Arrays.asList("bzaqsqsycbkbfk", "ukdkexxppofmxa", "c", "jpgd"))); - model = BinaryData.fromObject(model).toObject(GitHub.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("mvdjwzrlovmc", model.registration().clientId()); - Assertions.assertEquals("hijco", model.registration().clientSecretSettingName()); - Assertions.assertEquals("bzaqsqsycbkbfk", model.login().scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GlobalValidationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GlobalValidationTests.java deleted file mode 100644 index 10020a6f8e968..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GlobalValidationTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.GlobalValidation; -import com.azure.resourcemanager.appcontainers.models.UnauthenticatedClientActionV2; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class GlobalValidationTests { - @Test - public void testDeserialize() { - GlobalValidation model = - BinaryData - .fromString( - "{\"unauthenticatedClientAction\":\"AllowAnonymous\",\"redirectToProvider\":\"qnjaqwix\",\"excludedPaths\":[\"r\",\"zvcputegjvwmfda\",\"scmdvpjhulsuu\",\"mkjozkrwf\"]}") - .toObject(GlobalValidation.class); - Assertions.assertEquals(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS, model.unauthenticatedClientAction()); - Assertions.assertEquals("qnjaqwix", model.redirectToProvider()); - Assertions.assertEquals("r", model.excludedPaths().get(0)); - } - - @Test - public void testSerialize() { - GlobalValidation model = - new GlobalValidation() - .withUnauthenticatedClientAction(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS) - .withRedirectToProvider("qnjaqwix") - .withExcludedPaths(Arrays.asList("r", "zvcputegjvwmfda", "scmdvpjhulsuu", "mkjozkrwf")); - model = BinaryData.fromObject(model).toObject(GlobalValidation.class); - Assertions.assertEquals(UnauthenticatedClientActionV2.ALLOW_ANONYMOUS, model.unauthenticatedClientAction()); - Assertions.assertEquals("qnjaqwix", model.redirectToProvider()); - Assertions.assertEquals("r", model.excludedPaths().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GoogleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GoogleTests.java deleted file mode 100644 index 179b069ab5f62..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/GoogleTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.AllowedAudiencesValidation; -import com.azure.resourcemanager.appcontainers.models.ClientRegistration; -import com.azure.resourcemanager.appcontainers.models.Google; -import com.azure.resourcemanager.appcontainers.models.LoginScopes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class GoogleTests { - @Test - public void testDeserialize() { - Google model = - BinaryData - .fromString( - "{\"enabled\":true,\"registration\":{\"clientId\":\"dntwndeicbtw\",\"clientSecretSettingName\":\"zao\"},\"login\":{\"scopes\":[\"rhcffcydd\",\"lmjthjq\",\"wpyeicxmqciwqvh\",\"hix\"]},\"validation\":{\"allowedAudiences\":[\"topbobjogh\",\"e\"]}}") - .toObject(Google.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("dntwndeicbtw", model.registration().clientId()); - Assertions.assertEquals("zao", model.registration().clientSecretSettingName()); - Assertions.assertEquals("rhcffcydd", model.login().scopes().get(0)); - Assertions.assertEquals("topbobjogh", model.validation().allowedAudiences().get(0)); - } - - @Test - public void testSerialize() { - Google model = - new Google() - .withEnabled(true) - .withRegistration( - new ClientRegistration().withClientId("dntwndeicbtw").withClientSecretSettingName("zao")) - .withLogin( - new LoginScopes().withScopes(Arrays.asList("rhcffcydd", "lmjthjq", "wpyeicxmqciwqvh", "hix"))) - .withValidation( - new AllowedAudiencesValidation().withAllowedAudiences(Arrays.asList("topbobjogh", "e"))); - model = BinaryData.fromObject(model).toObject(Google.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("dntwndeicbtw", model.registration().clientId()); - Assertions.assertEquals("zao", model.registration().clientSecretSettingName()); - Assertions.assertEquals("rhcffcydd", model.login().scopes().get(0)); - Assertions.assertEquals("topbobjogh", model.validation().allowedAudiences().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpScaleRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpScaleRuleTests.java deleted file mode 100644 index b7b63122ec5d8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpScaleRuleTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.HttpScaleRule; -import com.azure.resourcemanager.appcontainers.models.ScaleRuleAuth; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class HttpScaleRuleTests { - @Test - public void testDeserialize() { - HttpScaleRule model = - BinaryData - .fromString( - "{\"metadata\":{\"x\":\"zuf\",\"khazxkhnzbonlwn\":\"iqopidoamciod\",\"szzcmrvexztv\":\"oegokdwbwh\",\"gsfraoyzkoow\":\"t\"},\"auth\":[{\"secretRef\":\"guxawqaldsyuuxi\",\"triggerParameter\":\"rqf\"},{\"secretRef\":\"wyznkbyku\",\"triggerParameter\":\"pfhpagmhrskdsnfd\"},{\"secretRef\":\"oakgtdlmkkzev\",\"triggerParameter\":\"hewpusdsttwv\"},{\"secretRef\":\"vbbejdcng\",\"triggerParameter\":\"m\"}]}") - .toObject(HttpScaleRule.class); - Assertions.assertEquals("zuf", model.metadata().get("x")); - Assertions.assertEquals("guxawqaldsyuuxi", model.auth().get(0).secretRef()); - Assertions.assertEquals("rqf", model.auth().get(0).triggerParameter()); - } - - @Test - public void testSerialize() { - HttpScaleRule model = - new HttpScaleRule() - .withMetadata( - mapOf( - "x", - "zuf", - "khazxkhnzbonlwn", - "iqopidoamciod", - "szzcmrvexztv", - "oegokdwbwh", - "gsfraoyzkoow", - "t")) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("guxawqaldsyuuxi").withTriggerParameter("rqf"), - new ScaleRuleAuth().withSecretRef("wyznkbyku").withTriggerParameter("pfhpagmhrskdsnfd"), - new ScaleRuleAuth().withSecretRef("oakgtdlmkkzev").withTriggerParameter("hewpusdsttwv"), - new ScaleRuleAuth().withSecretRef("vbbejdcng").withTriggerParameter("m"))); - model = BinaryData.fromObject(model).toObject(HttpScaleRule.class); - Assertions.assertEquals("zuf", model.metadata().get("x")); - Assertions.assertEquals("guxawqaldsyuuxi", model.auth().get(0).secretRef()); - Assertions.assertEquals("rqf", model.auth().get(0).triggerParameter()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsRoutesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsRoutesTests.java deleted file mode 100644 index 3c0b760a04e2e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsRoutesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.HttpSettingsRoutes; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class HttpSettingsRoutesTests { - @Test - public void testDeserialize() { - HttpSettingsRoutes model = - BinaryData.fromString("{\"apiPrefix\":\"ujjugwdkcglh\"}").toObject(HttpSettingsRoutes.class); - Assertions.assertEquals("ujjugwdkcglh", model.apiPrefix()); - } - - @Test - public void testSerialize() { - HttpSettingsRoutes model = new HttpSettingsRoutes().withApiPrefix("ujjugwdkcglh"); - model = BinaryData.fromObject(model).toObject(HttpSettingsRoutes.class); - Assertions.assertEquals("ujjugwdkcglh", model.apiPrefix()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsTests.java deleted file mode 100644 index eca2bf69f4de8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/HttpSettingsTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ForwardProxy; -import com.azure.resourcemanager.appcontainers.models.ForwardProxyConvention; -import com.azure.resourcemanager.appcontainers.models.HttpSettings; -import com.azure.resourcemanager.appcontainers.models.HttpSettingsRoutes; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class HttpSettingsTests { - @Test - public void testDeserialize() { - HttpSettings model = - BinaryData - .fromString( - "{\"requireHttps\":false,\"routes\":{\"apiPrefix\":\"zwdejbavor\"},\"forwardProxy\":{\"convention\":\"NoProxy\",\"customHostHeaderName\":\"hctbqvudwxdn\",\"customProtoHeaderName\":\"vo\"}}") - .toObject(HttpSettings.class); - Assertions.assertEquals(false, model.requireHttps()); - Assertions.assertEquals("zwdejbavor", model.routes().apiPrefix()); - Assertions.assertEquals(ForwardProxyConvention.NO_PROXY, model.forwardProxy().convention()); - Assertions.assertEquals("hctbqvudwxdn", model.forwardProxy().customHostHeaderName()); - Assertions.assertEquals("vo", model.forwardProxy().customProtoHeaderName()); - } - - @Test - public void testSerialize() { - HttpSettings model = - new HttpSettings() - .withRequireHttps(false) - .withRoutes(new HttpSettingsRoutes().withApiPrefix("zwdejbavor")) - .withForwardProxy( - new ForwardProxy() - .withConvention(ForwardProxyConvention.NO_PROXY) - .withCustomHostHeaderName("hctbqvudwxdn") - .withCustomProtoHeaderName("vo")); - model = BinaryData.fromObject(model).toObject(HttpSettings.class); - Assertions.assertEquals(false, model.requireHttps()); - Assertions.assertEquals("zwdejbavor", model.routes().apiPrefix()); - Assertions.assertEquals(ForwardProxyConvention.NO_PROXY, model.forwardProxy().convention()); - Assertions.assertEquals("hctbqvudwxdn", model.forwardProxy().customHostHeaderName()); - Assertions.assertEquals("vo", model.forwardProxy().customProtoHeaderName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressTests.java deleted file mode 100644 index 13301ab6eee78..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IngressTests.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Action; -import com.azure.resourcemanager.appcontainers.models.BindingType; -import com.azure.resourcemanager.appcontainers.models.CustomDomain; -import com.azure.resourcemanager.appcontainers.models.Ingress; -import com.azure.resourcemanager.appcontainers.models.IngressTransportMethod; -import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; -import com.azure.resourcemanager.appcontainers.models.TrafficWeight; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IngressTests { - @Test - public void testDeserialize() { - Ingress model = - BinaryData - .fromString( - "{\"fqdn\":\"rqhakauha\",\"external\":true,\"targetPort\":706986266,\"exposedPort\":949379958,\"transport\":\"http\",\"traffic\":[{\"revisionName\":\"cugicjoox\",\"weight\":554056666,\"latestRevision\":true,\"label\":\"ucww\"}],\"customDomains\":[{\"name\":\"vbvmeu\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"vyhzceuojgjrwj\"},{\"name\":\"eiotwmcdytdx\",\"bindingType\":\"Disabled\",\"certificateId\":\"xnrj\"},{\"name\":\"wgqwgxhn\",\"bindingType\":\"SniEnabled\",\"certificateId\":\"x\"}],\"allowInsecure\":true,\"ipSecurityRestrictions\":[{\"name\":\"cg\",\"description\":\"wndnhj\",\"ipAddressRange\":\"auwhvylwzbtdhx\",\"action\":\"Allow\"}]}") - .toObject(Ingress.class); - Assertions.assertEquals(true, model.external()); - Assertions.assertEquals(706986266, model.targetPort()); - Assertions.assertEquals(949379958, model.exposedPort()); - Assertions.assertEquals(IngressTransportMethod.HTTP, model.transport()); - Assertions.assertEquals("cugicjoox", model.traffic().get(0).revisionName()); - Assertions.assertEquals(554056666, model.traffic().get(0).weight()); - Assertions.assertEquals(true, model.traffic().get(0).latestRevision()); - Assertions.assertEquals("ucww", model.traffic().get(0).label()); - Assertions.assertEquals("vbvmeu", model.customDomains().get(0).name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, model.customDomains().get(0).bindingType()); - Assertions.assertEquals("vyhzceuojgjrwj", model.customDomains().get(0).certificateId()); - Assertions.assertEquals(true, model.allowInsecure()); - Assertions.assertEquals("cg", model.ipSecurityRestrictions().get(0).name()); - Assertions.assertEquals("wndnhj", model.ipSecurityRestrictions().get(0).description()); - Assertions.assertEquals("auwhvylwzbtdhx", model.ipSecurityRestrictions().get(0).ipAddressRange()); - Assertions.assertEquals(Action.ALLOW, model.ipSecurityRestrictions().get(0).action()); - } - - @Test - public void testSerialize() { - Ingress model = - new Ingress() - .withExternal(true) - .withTargetPort(706986266) - .withExposedPort(949379958) - .withTransport(IngressTransportMethod.HTTP) - .withTraffic( - Arrays - .asList( - new TrafficWeight() - .withRevisionName("cugicjoox") - .withWeight(554056666) - .withLatestRevision(true) - .withLabel("ucww"))) - .withCustomDomains( - Arrays - .asList( - new CustomDomain() - .withName("vbvmeu") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("vyhzceuojgjrwj"), - new CustomDomain() - .withName("eiotwmcdytdx") - .withBindingType(BindingType.DISABLED) - .withCertificateId("xnrj"), - new CustomDomain() - .withName("wgqwgxhn") - .withBindingType(BindingType.SNI_ENABLED) - .withCertificateId("x"))) - .withAllowInsecure(true) - .withIpSecurityRestrictions( - Arrays - .asList( - new IpSecurityRestrictionRule() - .withName("cg") - .withDescription("wndnhj") - .withIpAddressRange("auwhvylwzbtdhx") - .withAction(Action.ALLOW))); - model = BinaryData.fromObject(model).toObject(Ingress.class); - Assertions.assertEquals(true, model.external()); - Assertions.assertEquals(706986266, model.targetPort()); - Assertions.assertEquals(949379958, model.exposedPort()); - Assertions.assertEquals(IngressTransportMethod.HTTP, model.transport()); - Assertions.assertEquals("cugicjoox", model.traffic().get(0).revisionName()); - Assertions.assertEquals(554056666, model.traffic().get(0).weight()); - Assertions.assertEquals(true, model.traffic().get(0).latestRevision()); - Assertions.assertEquals("ucww", model.traffic().get(0).label()); - Assertions.assertEquals("vbvmeu", model.customDomains().get(0).name()); - Assertions.assertEquals(BindingType.SNI_ENABLED, model.customDomains().get(0).bindingType()); - Assertions.assertEquals("vyhzceuojgjrwj", model.customDomains().get(0).certificateId()); - Assertions.assertEquals(true, model.allowInsecure()); - Assertions.assertEquals("cg", model.ipSecurityRestrictions().get(0).name()); - Assertions.assertEquals("wndnhj", model.ipSecurityRestrictions().get(0).description()); - Assertions.assertEquals("auwhvylwzbtdhx", model.ipSecurityRestrictions().get(0).ipAddressRange()); - Assertions.assertEquals(Action.ALLOW, model.ipSecurityRestrictions().get(0).action()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/InitContainerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/InitContainerTests.java deleted file mode 100644 index af16468c0e501..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/InitContainerTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.EnvironmentVar; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.VolumeMount; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class InitContainerTests { - @Test - public void testDeserialize() { - InitContainer model = - BinaryData - .fromString( - "{\"image\":\"ogqxndlkzgxhuri\",\"name\":\"bpodxunkbebxm\",\"command\":[\"yntwlrbq\",\"koievseo\"],\"args\":[\"rlltmuwlauwzizx\"],\"env\":[{\"name\":\"cjefuzmu\",\"value\":\"bttdumorppxe\",\"secretRef\":\"nzbtbhj\"},{\"name\":\"lkfg\",\"value\":\"dneu\",\"secretRef\":\"fphsdyhtozfikdow\"},{\"name\":\"uuvxz\",\"value\":\"lvithhqzonosgg\",\"secretRef\":\"c\"}],\"resources\":{\"cpu\":61.21975235277173,\"memory\":\"jnkaljutiiswacff\",\"ephemeralStorage\":\"k\"},\"volumeMounts\":[{\"volumeName\":\"kfvhqcrailvpn\",\"mountPath\":\"fuflrwdmhdlx\"},{\"volumeName\":\"rxsagafcnihgwqa\",\"mountPath\":\"edgfbcvkcvq\"},{\"volumeName\":\"keqdcvdrhvoods\",\"mountPath\":\"bobzdopcjwvnhd\"}]}") - .toObject(InitContainer.class); - Assertions.assertEquals("ogqxndlkzgxhuri", model.image()); - Assertions.assertEquals("bpodxunkbebxm", model.name()); - Assertions.assertEquals("yntwlrbq", model.command().get(0)); - Assertions.assertEquals("rlltmuwlauwzizx", model.args().get(0)); - Assertions.assertEquals("cjefuzmu", model.env().get(0).name()); - Assertions.assertEquals("bttdumorppxe", model.env().get(0).value()); - Assertions.assertEquals("nzbtbhj", model.env().get(0).secretRef()); - Assertions.assertEquals(61.21975235277173D, model.resources().cpu()); - Assertions.assertEquals("jnkaljutiiswacff", model.resources().memory()); - Assertions.assertEquals("kfvhqcrailvpn", model.volumeMounts().get(0).volumeName()); - Assertions.assertEquals("fuflrwdmhdlx", model.volumeMounts().get(0).mountPath()); - } - - @Test - public void testSerialize() { - InitContainer model = - new InitContainer() - .withImage("ogqxndlkzgxhuri") - .withName("bpodxunkbebxm") - .withCommand(Arrays.asList("yntwlrbq", "koievseo")) - .withArgs(Arrays.asList("rlltmuwlauwzizx")) - .withEnv( - Arrays - .asList( - new EnvironmentVar() - .withName("cjefuzmu") - .withValue("bttdumorppxe") - .withSecretRef("nzbtbhj"), - new EnvironmentVar().withName("lkfg").withValue("dneu").withSecretRef("fphsdyhtozfikdow"), - new EnvironmentVar().withName("uuvxz").withValue("lvithhqzonosgg").withSecretRef("c"))) - .withResources(new ContainerResources().withCpu(61.21975235277173D).withMemory("jnkaljutiiswacff")) - .withVolumeMounts( - Arrays - .asList( - new VolumeMount().withVolumeName("kfvhqcrailvpn").withMountPath("fuflrwdmhdlx"), - new VolumeMount().withVolumeName("rxsagafcnihgwqa").withMountPath("edgfbcvkcvq"), - new VolumeMount().withVolumeName("keqdcvdrhvoods").withMountPath("bobzdopcjwvnhd"))); - model = BinaryData.fromObject(model).toObject(InitContainer.class); - Assertions.assertEquals("ogqxndlkzgxhuri", model.image()); - Assertions.assertEquals("bpodxunkbebxm", model.name()); - Assertions.assertEquals("yntwlrbq", model.command().get(0)); - Assertions.assertEquals("rlltmuwlauwzizx", model.args().get(0)); - Assertions.assertEquals("cjefuzmu", model.env().get(0).name()); - Assertions.assertEquals("bttdumorppxe", model.env().get(0).value()); - Assertions.assertEquals("nzbtbhj", model.env().get(0).secretRef()); - Assertions.assertEquals(61.21975235277173D, model.resources().cpu()); - Assertions.assertEquals("jnkaljutiiswacff", model.resources().memory()); - Assertions.assertEquals("kfvhqcrailvpn", model.volumeMounts().get(0).volumeName()); - Assertions.assertEquals("fuflrwdmhdlx", model.volumeMounts().get(0).mountPath()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IpSecurityRestrictionRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IpSecurityRestrictionRuleTests.java deleted file mode 100644 index 46ffee4349ed2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/IpSecurityRestrictionRuleTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Action; -import com.azure.resourcemanager.appcontainers.models.IpSecurityRestrictionRule; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class IpSecurityRestrictionRuleTests { - @Test - public void testDeserialize() { - IpSecurityRestrictionRule model = - BinaryData - .fromString( - "{\"name\":\"gw\",\"description\":\"vlvqhjkbegi\",\"ipAddressRange\":\"t\",\"action\":\"Allow\"}") - .toObject(IpSecurityRestrictionRule.class); - Assertions.assertEquals("gw", model.name()); - Assertions.assertEquals("vlvqhjkbegi", model.description()); - Assertions.assertEquals("t", model.ipAddressRange()); - Assertions.assertEquals(Action.ALLOW, model.action()); - } - - @Test - public void testSerialize() { - IpSecurityRestrictionRule model = - new IpSecurityRestrictionRule() - .withName("gw") - .withDescription("vlvqhjkbegi") - .withIpAddressRange("t") - .withAction(Action.ALLOW); - model = BinaryData.fromObject(model).toObject(IpSecurityRestrictionRule.class); - Assertions.assertEquals("gw", model.name()); - Assertions.assertEquals("vlvqhjkbegi", model.description()); - Assertions.assertEquals("t", model.ipAddressRange()); - Assertions.assertEquals(Action.ALLOW, model.action()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JwtClaimChecksTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JwtClaimChecksTests.java deleted file mode 100644 index 145f7fcb84cf6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/JwtClaimChecksTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.JwtClaimChecks; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class JwtClaimChecksTests { - @Test - public void testDeserialize() { - JwtClaimChecks model = - BinaryData - .fromString( - "{\"allowedGroups\":[\"qpteeh\",\"zvypyqrimzinp\"],\"allowedClientApplications\":[\"jdkirsoodqx\"]}") - .toObject(JwtClaimChecks.class); - Assertions.assertEquals("qpteeh", model.allowedGroups().get(0)); - Assertions.assertEquals("jdkirsoodqx", model.allowedClientApplications().get(0)); - } - - @Test - public void testSerialize() { - JwtClaimChecks model = - new JwtClaimChecks() - .withAllowedGroups(Arrays.asList("qpteeh", "zvypyqrimzinp")) - .withAllowedClientApplications(Arrays.asList("jdkirsoodqx")); - model = BinaryData.fromObject(model).toObject(JwtClaimChecks.class); - Assertions.assertEquals("qpteeh", model.allowedGroups().get(0)); - Assertions.assertEquals("jdkirsoodqx", model.allowedClientApplications().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginRoutesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginRoutesTests.java deleted file mode 100644 index 45f53f49ccabb..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginRoutesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.LoginRoutes; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LoginRoutesTests { - @Test - public void testDeserialize() { - LoginRoutes model = BinaryData.fromString("{\"logoutEndpoint\":\"ynpwlbj\"}").toObject(LoginRoutes.class); - Assertions.assertEquals("ynpwlbj", model.logoutEndpoint()); - } - - @Test - public void testSerialize() { - LoginRoutes model = new LoginRoutes().withLogoutEndpoint("ynpwlbj"); - model = BinaryData.fromObject(model).toObject(LoginRoutes.class); - Assertions.assertEquals("ynpwlbj", model.logoutEndpoint()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginScopesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginScopesTests.java deleted file mode 100644 index 17b344da6d8cf..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginScopesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.LoginScopes; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LoginScopesTests { - @Test - public void testDeserialize() { - LoginScopes model = - BinaryData - .fromString("{\"scopes\":[\"nbdxk\",\"pxokajionp\",\"mexgstxgcp\",\"dg\"]}") - .toObject(LoginScopes.class); - Assertions.assertEquals("nbdxk", model.scopes().get(0)); - } - - @Test - public void testSerialize() { - LoginScopes model = new LoginScopes().withScopes(Arrays.asList("nbdxk", "pxokajionp", "mexgstxgcp", "dg")); - model = BinaryData.fromObject(model).toObject(LoginScopes.class); - Assertions.assertEquals("nbdxk", model.scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginTests.java deleted file mode 100644 index 11562c775556b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/LoginTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CookieExpiration; -import com.azure.resourcemanager.appcontainers.models.CookieExpirationConvention; -import com.azure.resourcemanager.appcontainers.models.Login; -import com.azure.resourcemanager.appcontainers.models.LoginRoutes; -import com.azure.resourcemanager.appcontainers.models.Nonce; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class LoginTests { - @Test - public void testDeserialize() { - Login model = - BinaryData - .fromString( - "{\"routes\":{\"logoutEndpoint\":\"jumasx\"},\"preserveUrlFragmentsForLogins\":false,\"allowedExternalRedirectUrls\":[\"yegu\"],\"cookieExpiration\":{\"convention\":\"FixedTime\",\"timeToExpiration\":\"xhejjzzvdud\"},\"nonce\":{\"validateNonce\":false,\"nonceExpirationInterval\":\"fhotw\"}}") - .toObject(Login.class); - Assertions.assertEquals("jumasx", model.routes().logoutEndpoint()); - Assertions.assertEquals(false, model.preserveUrlFragmentsForLogins()); - Assertions.assertEquals("yegu", model.allowedExternalRedirectUrls().get(0)); - Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.cookieExpiration().convention()); - Assertions.assertEquals("xhejjzzvdud", model.cookieExpiration().timeToExpiration()); - Assertions.assertEquals(false, model.nonce().validateNonce()); - Assertions.assertEquals("fhotw", model.nonce().nonceExpirationInterval()); - } - - @Test - public void testSerialize() { - Login model = - new Login() - .withRoutes(new LoginRoutes().withLogoutEndpoint("jumasx")) - .withPreserveUrlFragmentsForLogins(false) - .withAllowedExternalRedirectUrls(Arrays.asList("yegu")) - .withCookieExpiration( - new CookieExpiration() - .withConvention(CookieExpirationConvention.FIXED_TIME) - .withTimeToExpiration("xhejjzzvdud")) - .withNonce(new Nonce().withValidateNonce(false).withNonceExpirationInterval("fhotw")); - model = BinaryData.fromObject(model).toObject(Login.class); - Assertions.assertEquals("jumasx", model.routes().logoutEndpoint()); - Assertions.assertEquals(false, model.preserveUrlFragmentsForLogins()); - Assertions.assertEquals("yegu", model.allowedExternalRedirectUrls().get(0)); - Assertions.assertEquals(CookieExpirationConvention.FIXED_TIME, model.cookieExpiration().convention()); - Assertions.assertEquals("xhejjzzvdud", model.cookieExpiration().timeToExpiration()); - Assertions.assertEquals(false, model.nonce().validateNonce()); - Assertions.assertEquals("fhotw", model.nonce().nonceExpirationInterval()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentOutboundSettingsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentOutboundSettingsTests.java deleted file mode 100644 index 44c4894e66531..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentOutboundSettingsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutBoundType; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutboundSettings; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedEnvironmentOutboundSettingsTests { - @Test - public void testDeserialize() { - ManagedEnvironmentOutboundSettings model = - BinaryData - .fromString("{\"outBoundType\":\"UserDefinedRouting\",\"virtualNetworkApplianceIp\":\"l\"}") - .toObject(ManagedEnvironmentOutboundSettings.class); - Assertions.assertEquals(ManagedEnvironmentOutBoundType.USER_DEFINED_ROUTING, model.outBoundType()); - Assertions.assertEquals("l", model.virtualNetworkApplianceIp()); - } - - @Test - public void testSerialize() { - ManagedEnvironmentOutboundSettings model = - new ManagedEnvironmentOutboundSettings() - .withOutBoundType(ManagedEnvironmentOutBoundType.USER_DEFINED_ROUTING) - .withVirtualNetworkApplianceIp("l"); - model = BinaryData.fromObject(model).toObject(ManagedEnvironmentOutboundSettings.class); - Assertions.assertEquals(ManagedEnvironmentOutBoundType.USER_DEFINED_ROUTING, model.outBoundType()); - Assertions.assertEquals("l", model.virtualNetworkApplianceIp()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentStoragesCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentStoragesCollectionInnerTests.java deleted file mode 100644 index 8cdd205d2c8c0..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentStoragesCollectionInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentStorageInner; -import com.azure.resourcemanager.appcontainers.fluent.models.ManagedEnvironmentStoragesCollectionInner; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentStorageProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class ManagedEnvironmentStoragesCollectionInnerTests { - @Test - public void testDeserialize() { - ManagedEnvironmentStoragesCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"ob\",\"name\":\"lftidgfcwqmpim\",\"type\":\"qxzhem\"},{\"properties\":{},\"id\":\"hujswtwkozzwcul\",\"name\":\"bawpfajnjwltlwt\",\"type\":\"j\"},{\"properties\":{},\"id\":\"alhsnvkc\",\"name\":\"mxzrpoa\",\"type\":\"mlnwiaaomylweazu\"},{\"properties\":{},\"id\":\"thwwn\",\"name\":\"jhlfzswpchwahf\",\"type\":\"ousnfepgfewe\"}]}") - .toObject(ManagedEnvironmentStoragesCollectionInner.class); - } - - @Test - public void testSerialize() { - ManagedEnvironmentStoragesCollectionInner model = - new ManagedEnvironmentStoragesCollectionInner() - .withValue( - Arrays - .asList( - new ManagedEnvironmentStorageInner() - .withProperties(new ManagedEnvironmentStorageProperties()), - new ManagedEnvironmentStorageInner() - .withProperties(new ManagedEnvironmentStorageProperties()), - new ManagedEnvironmentStorageInner() - .withProperties(new ManagedEnvironmentStorageProperties()), - new ManagedEnvironmentStorageInner() - .withProperties(new ManagedEnvironmentStorageProperties()))); - model = BinaryData.fromObject(model).toObject(ManagedEnvironmentStoragesCollectionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteMockTests.java deleted file mode 100644 index 89cd42aeeb105..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsDeleteMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.managedEnvironments().delete("owa", "iynknlq", Context.NONE); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesMockTests.java deleted file mode 100644 index dc608af595c67..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedEnvironmentsListWorkloadProfileStatesMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStates; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ManagedEnvironmentsListWorkloadProfileStatesMockTests { - @Test - public void testListWorkloadProfileStates() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"minimumCount\":1932910769,\"maximumCount\":356571550,\"currentCount\":150383679},\"id\":\"ygjbmzyospspsh\",\"name\":\"kfkyjp\",\"type\":\"sp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.managedEnvironments().listWorkloadProfileStates("zdvpiw", "xqszdtmaajquh", Context.NONE); - - Assertions.assertEquals(1932910769, response.iterator().next().properties().minimumCount()); - Assertions.assertEquals(356571550, response.iterator().next().properties().maximumCount()); - Assertions.assertEquals(150383679, response.iterator().next().properties().currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedServiceIdentityTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index 9a173242c2186..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentity; -import com.azure.resourcemanager.appcontainers.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ManagedServiceIdentityTests { - @Test - public void testDeserialize() { - ManagedServiceIdentity model = - BinaryData - .fromString( - "{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"frzpwvlqdqgb\":{},\"lihkaetcktvfc\":{},\"snkymuctq\":{},\"bebrjcxerfuwuttt\":{}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @Test - public void testSerialize() { - ManagedServiceIdentity model = - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "frzpwvlqdqgb", - new UserAssignedIdentity(), - "lihkaetcktvfc", - new UserAssignedIdentity(), - "snkymuctq", - new UserAssignedIdentity(), - "bebrjcxerfuwuttt", - new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NonceTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NonceTests.java deleted file mode 100644 index 9edebf90dfe79..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/NonceTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Nonce; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class NonceTests { - @Test - public void testDeserialize() { - Nonce model = - BinaryData - .fromString("{\"validateNonce\":false,\"nonceExpirationInterval\":\"yfsoppu\"}") - .toObject(Nonce.class); - Assertions.assertEquals(false, model.validateNonce()); - Assertions.assertEquals("yfsoppu", model.nonceExpirationInterval()); - } - - @Test - public void testSerialize() { - Nonce model = new Nonce().withValidateNonce(false).withNonceExpirationInterval("yfsoppu"); - model = BinaryData.fromObject(model).toObject(Nonce.class); - Assertions.assertEquals(false, model.validateNonce()); - Assertions.assertEquals("yfsoppu", model.nonceExpirationInterval()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectClientCredentialTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectClientCredentialTests.java deleted file mode 100644 index ee854acd908ae..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectClientCredentialTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ClientCredentialMethod; -import com.azure.resourcemanager.appcontainers.models.OpenIdConnectClientCredential; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OpenIdConnectClientCredentialTests { - @Test - public void testDeserialize() { - OpenIdConnectClientCredential model = - BinaryData - .fromString("{\"method\":\"ClientSecretPost\",\"clientSecretSettingName\":\"tzxdpnqbqqwx\"}") - .toObject(OpenIdConnectClientCredential.class); - Assertions.assertEquals(ClientCredentialMethod.CLIENT_SECRET_POST, model.method()); - Assertions.assertEquals("tzxdpnqbqqwx", model.clientSecretSettingName()); - } - - @Test - public void testSerialize() { - OpenIdConnectClientCredential model = - new OpenIdConnectClientCredential() - .withMethod(ClientCredentialMethod.CLIENT_SECRET_POST) - .withClientSecretSettingName("tzxdpnqbqqwx"); - model = BinaryData.fromObject(model).toObject(OpenIdConnectClientCredential.class); - Assertions.assertEquals(ClientCredentialMethod.CLIENT_SECRET_POST, model.method()); - Assertions.assertEquals("tzxdpnqbqqwx", model.clientSecretSettingName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectLoginTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectLoginTests.java deleted file mode 100644 index 6afae76954b89..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OpenIdConnectLoginTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.OpenIdConnectLogin; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OpenIdConnectLoginTests { - @Test - public void testDeserialize() { - OpenIdConnectLogin model = - BinaryData - .fromString( - "{\"nameClaimType\":\"scxaq\",\"scopes\":[\"chcbonqvpkvlrxnj\",\"ase\",\"pheoflokeyy\",\"enjbdlwtgrhp\"]}") - .toObject(OpenIdConnectLogin.class); - Assertions.assertEquals("scxaq", model.nameClaimType()); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.scopes().get(0)); - } - - @Test - public void testSerialize() { - OpenIdConnectLogin model = - new OpenIdConnectLogin() - .withNameClaimType("scxaq") - .withScopes(Arrays.asList("chcbonqvpkvlrxnj", "ase", "pheoflokeyy", "enjbdlwtgrhp")); - model = BinaryData.fromObject(model).toObject(OpenIdConnectLogin.class); - Assertions.assertEquals("scxaq", model.nameClaimType()); - Assertions.assertEquals("chcbonqvpkvlrxnj", model.scopes().get(0)); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDetailInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDetailInnerTests.java deleted file mode 100644 index bb6d2928426c1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDetailInnerTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.appcontainers.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OperationDetailInnerTests { - @Test - public void testDeserialize() { - OperationDetailInner model = - BinaryData - .fromString( - "{\"name\":\"qyuvvfonkp\",\"isDataAction\":false,\"display\":{\"provider\":\"kvylauyavl\",\"resource\":\"mncsttijfybvp\",\"operation\":\"krsgsgb\",\"description\":\"uzqgnjdgkynsc\"},\"origin\":\"qhzvhxnkomt\"}") - .toObject(OperationDetailInner.class); - Assertions.assertEquals("qyuvvfonkp", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("kvylauyavl", model.display().provider()); - Assertions.assertEquals("mncsttijfybvp", model.display().resource()); - Assertions.assertEquals("krsgsgb", model.display().operation()); - Assertions.assertEquals("uzqgnjdgkynsc", model.display().description()); - Assertions.assertEquals("qhzvhxnkomt", model.origin()); - } - - @Test - public void testSerialize() { - OperationDetailInner model = - new OperationDetailInner() - .withName("qyuvvfonkp") - .withIsDataAction(false) - .withDisplay( - new OperationDisplay() - .withProvider("kvylauyavl") - .withResource("mncsttijfybvp") - .withOperation("krsgsgb") - .withDescription("uzqgnjdgkynsc")) - .withOrigin("qhzvhxnkomt"); - model = BinaryData.fromObject(model).toObject(OperationDetailInner.class); - Assertions.assertEquals("qyuvvfonkp", model.name()); - Assertions.assertEquals(false, model.isDataAction()); - Assertions.assertEquals("kvylauyavl", model.display().provider()); - Assertions.assertEquals("mncsttijfybvp", model.display().resource()); - Assertions.assertEquals("krsgsgb", model.display().operation()); - Assertions.assertEquals("uzqgnjdgkynsc", model.display().description()); - Assertions.assertEquals("qhzvhxnkomt", model.origin()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDisplayTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDisplayTests.java deleted file mode 100644 index feb8216ddb9fe..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationDisplayTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class OperationDisplayTests { - @Test - public void testDeserialize() { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"bo\",\"resource\":\"pnvdxz\",\"operation\":\"ihfrbbcevqa\",\"description\":\"ltd\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("bo", model.provider()); - Assertions.assertEquals("pnvdxz", model.resource()); - Assertions.assertEquals("ihfrbbcevqa", model.operation()); - Assertions.assertEquals("ltd", model.description()); - } - - @Test - public void testSerialize() { - OperationDisplay model = - new OperationDisplay() - .withProvider("bo") - .withResource("pnvdxz") - .withOperation("ihfrbbcevqa") - .withDescription("ltd"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("bo", model.provider()); - Assertions.assertEquals("pnvdxz", model.resource()); - Assertions.assertEquals("ihfrbbcevqa", model.operation()); - Assertions.assertEquals("ltd", model.description()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationsListMockTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationsListMockTests.java deleted file mode 100644 index 46c0b3a54f056..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/OperationsListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Context; -import com.azure.resourcemanager.appcontainers.ContainerAppsApiManager; -import com.azure.resourcemanager.appcontainers.models.OperationDetail; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"kgozxwop\",\"isDataAction\":false,\"display\":{\"provider\":\"izqaclnapxbiyg\",\"resource\":\"gjkn\",\"operation\":\"mfcttux\",\"description\":\"yilflqoiquvrehmr\"},\"origin\":\"hvsujztc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ContainerAppsApiManager manager = - ContainerAppsApiManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(Context.NONE); - - Assertions.assertEquals("kgozxwop", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("izqaclnapxbiyg", response.iterator().next().display().provider()); - Assertions.assertEquals("gjkn", response.iterator().next().display().resource()); - Assertions.assertEquals("mfcttux", response.iterator().next().display().operation()); - Assertions.assertEquals("yilflqoiquvrehmr", response.iterator().next().display().description()); - Assertions.assertEquals("hvsujztc", response.iterator().next().origin()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/QueueScaleRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/QueueScaleRuleTests.java deleted file mode 100644 index 71b0cc930752a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/QueueScaleRuleTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.QueueScaleRule; -import com.azure.resourcemanager.appcontainers.models.ScaleRuleAuth; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class QueueScaleRuleTests { - @Test - public void testDeserialize() { - QueueScaleRule model = - BinaryData - .fromString( - "{\"queueName\":\"bqwcsdbnwdcf\",\"queueLength\":1857074792,\"auth\":[{\"secretRef\":\"fuvglsbjjca\",\"triggerParameter\":\"xbvtvudu\"},{\"secretRef\":\"cormr\",\"triggerParameter\":\"qtvcofudflvkgj\"}]}") - .toObject(QueueScaleRule.class); - Assertions.assertEquals("bqwcsdbnwdcf", model.queueName()); - Assertions.assertEquals(1857074792, model.queueLength()); - Assertions.assertEquals("fuvglsbjjca", model.auth().get(0).secretRef()); - Assertions.assertEquals("xbvtvudu", model.auth().get(0).triggerParameter()); - } - - @Test - public void testSerialize() { - QueueScaleRule model = - new QueueScaleRule() - .withQueueName("bqwcsdbnwdcf") - .withQueueLength(1857074792) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("fuvglsbjjca").withTriggerParameter("xbvtvudu"), - new ScaleRuleAuth().withSecretRef("cormr").withTriggerParameter("qtvcofudflvkgj"))); - model = BinaryData.fromObject(model).toObject(QueueScaleRule.class); - Assertions.assertEquals("bqwcsdbnwdcf", model.queueName()); - Assertions.assertEquals(1857074792, model.queueLength()); - Assertions.assertEquals("fuvglsbjjca", model.auth().get(0).secretRef()); - Assertions.assertEquals("xbvtvudu", model.auth().get(0).triggerParameter()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RegistryCredentialsTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RegistryCredentialsTests.java deleted file mode 100644 index 361335f269c8d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RegistryCredentialsTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.RegistryCredentials; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RegistryCredentialsTests { - @Test - public void testDeserialize() { - RegistryCredentials model = - BinaryData - .fromString( - "{\"server\":\"iebwwaloayqcgwrt\",\"username\":\"uzgwyzmhtx\",\"passwordSecretRef\":\"gmtsavjcbpwxqpsr\",\"identity\":\"ftguv\"}") - .toObject(RegistryCredentials.class); - Assertions.assertEquals("iebwwaloayqcgwrt", model.server()); - Assertions.assertEquals("uzgwyzmhtx", model.username()); - Assertions.assertEquals("gmtsavjcbpwxqpsr", model.passwordSecretRef()); - Assertions.assertEquals("ftguv", model.identity()); - } - - @Test - public void testSerialize() { - RegistryCredentials model = - new RegistryCredentials() - .withServer("iebwwaloayqcgwrt") - .withUsername("uzgwyzmhtx") - .withPasswordSecretRef("gmtsavjcbpwxqpsr") - .withIdentity("ftguv"); - model = BinaryData.fromObject(model).toObject(RegistryCredentials.class); - Assertions.assertEquals("iebwwaloayqcgwrt", model.server()); - Assertions.assertEquals("uzgwyzmhtx", model.username()); - Assertions.assertEquals("gmtsavjcbpwxqpsr", model.passwordSecretRef()); - Assertions.assertEquals("ftguv", model.identity()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RegistryInfoTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RegistryInfoTests.java deleted file mode 100644 index d17152ba628ec..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RegistryInfoTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.RegistryInfo; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class RegistryInfoTests { - @Test - public void testDeserialize() { - RegistryInfo model = - BinaryData - .fromString( - "{\"registryUrl\":\"fakeUrlPlaceholder\",\"registryUserName\":\"fakeNamePlaceholder\",\"registryPassword\":\"fakePasswordPlaceholder\"}") - .toObject(RegistryInfo.class); - Assertions.assertEquals("fakeUrlPlaceholder", model.registryUrl()); - Assertions.assertEquals("fakeNamePlaceholder", model.registryUsername()); - Assertions.assertEquals("fakePasswordPlaceholder", model.registryPassword()); - } - - @Test - public void testSerialize() { - RegistryInfo model = - new RegistryInfo() - .withRegistryUrl("fakeUrlPlaceholder") - .withRegistryUsername("fakeNamePlaceholder") - .withRegistryPassword("fakePasswordPlaceholder"); - model = BinaryData.fromObject(model).toObject(RegistryInfo.class); - Assertions.assertEquals("fakeUrlPlaceholder", model.registryUrl()); - Assertions.assertEquals("fakeNamePlaceholder", model.registryUsername()); - Assertions.assertEquals("fakePasswordPlaceholder", model.registryPassword()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaCollectionInnerTests.java deleted file mode 100644 index 5a74a66a414c2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaCollectionInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaCollectionInner; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class ReplicaCollectionInnerTests { - @Test - public void testDeserialize() { - ReplicaCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-01-22T12:04:18Z\",\"containers\":[]},\"id\":\"fffiak\",\"name\":\"jpqqmted\",\"type\":\"tmmjihyeozph\"},{\"properties\":{\"createdTime\":\"2021-06-27T09:23:26Z\",\"containers\":[]},\"id\":\"ncyg\",\"name\":\"p\",\"type\":\"vipmdscwxqupevzh\"}]}") - .toObject(ReplicaCollectionInner.class); - } - - @Test - public void testSerialize() { - ReplicaCollectionInner model = - new ReplicaCollectionInner() - .withValue( - Arrays - .asList( - new ReplicaInner().withContainers(Arrays.asList()), - new ReplicaInner().withContainers(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(ReplicaCollectionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaContainerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaContainerTests.java deleted file mode 100644 index cc77f7b8f1c75..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaContainerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ReplicaContainerTests { - @Test - public void testDeserialize() { - ReplicaContainer model = - BinaryData - .fromString( - "{\"name\":\"fhsxttaugz\",\"containerId\":\"faazpxdtnkdmkqjj\",\"ready\":false,\"started\":false,\"restartCount\":1886433502,\"logStreamEndpoint\":\"pyouaibrebqaays\",\"execEndpoint\":\"ixqtn\"}") - .toObject(ReplicaContainer.class); - Assertions.assertEquals("fhsxttaugz", model.name()); - Assertions.assertEquals("faazpxdtnkdmkqjj", model.containerId()); - Assertions.assertEquals(false, model.ready()); - Assertions.assertEquals(false, model.started()); - Assertions.assertEquals(1886433502, model.restartCount()); - } - - @Test - public void testSerialize() { - ReplicaContainer model = - new ReplicaContainer() - .withName("fhsxttaugz") - .withContainerId("faazpxdtnkdmkqjj") - .withReady(false) - .withStarted(false) - .withRestartCount(1886433502); - model = BinaryData.fromObject(model).toObject(ReplicaContainer.class); - Assertions.assertEquals("fhsxttaugz", model.name()); - Assertions.assertEquals("faazpxdtnkdmkqjj", model.containerId()); - Assertions.assertEquals(false, model.ready()); - Assertions.assertEquals(false, model.started()); - Assertions.assertEquals(1886433502, model.restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaInnerTests.java deleted file mode 100644 index 2bc20409ed83b..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaInner; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ReplicaInnerTests { - @Test - public void testDeserialize() { - ReplicaInner model = - BinaryData - .fromString( - "{\"properties\":{\"createdTime\":\"2021-03-31T08:41:02Z\",\"containers\":[{\"name\":\"nkhtjsyingw\",\"containerId\":\"atmtdhtmdvy\",\"ready\":true,\"started\":true,\"restartCount\":624157964,\"logStreamEndpoint\":\"ywkbirryuzhlhkjo\",\"execEndpoint\":\"vqqaatjinrvgo\"},{\"name\":\"mfiibfggj\",\"containerId\":\"olvrw\",\"ready\":false,\"started\":false,\"restartCount\":1621053169,\"logStreamEndpoint\":\"lqwjygvjayvblm\",\"execEndpoint\":\"k\"}]},\"id\":\"hbxvvyhgsopbyrqu\",\"name\":\"egxuvwzf\",\"type\":\"nhlmctlpdng\"}") - .toObject(ReplicaInner.class); - Assertions.assertEquals("nkhtjsyingw", model.containers().get(0).name()); - Assertions.assertEquals("atmtdhtmdvy", model.containers().get(0).containerId()); - Assertions.assertEquals(true, model.containers().get(0).ready()); - Assertions.assertEquals(true, model.containers().get(0).started()); - Assertions.assertEquals(624157964, model.containers().get(0).restartCount()); - } - - @Test - public void testSerialize() { - ReplicaInner model = - new ReplicaInner() - .withContainers( - Arrays - .asList( - new ReplicaContainer() - .withName("nkhtjsyingw") - .withContainerId("atmtdhtmdvy") - .withReady(true) - .withStarted(true) - .withRestartCount(624157964), - new ReplicaContainer() - .withName("mfiibfggj") - .withContainerId("olvrw") - .withReady(false) - .withStarted(false) - .withRestartCount(1621053169))); - model = BinaryData.fromObject(model).toObject(ReplicaInner.class); - Assertions.assertEquals("nkhtjsyingw", model.containers().get(0).name()); - Assertions.assertEquals("atmtdhtmdvy", model.containers().get(0).containerId()); - Assertions.assertEquals(true, model.containers().get(0).ready()); - Assertions.assertEquals(true, model.containers().get(0).started()); - Assertions.assertEquals(624157964, model.containers().get(0).restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaPropertiesTests.java deleted file mode 100644 index 93258565b3ca3..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ReplicaPropertiesTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.ReplicaProperties; -import com.azure.resourcemanager.appcontainers.models.ReplicaContainer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ReplicaPropertiesTests { - @Test - public void testDeserialize() { - ReplicaProperties model = - BinaryData - .fromString( - "{\"createdTime\":\"2021-01-29T19:24:27Z\",\"containers\":[{\"name\":\"hrixkwmy\",\"containerId\":\"ejvegrhbpnaixex\",\"ready\":false,\"started\":true,\"restartCount\":303838192,\"logStreamEndpoint\":\"hcexdrrvqa\",\"execEndpoint\":\"kghtpwijnh\"},{\"name\":\"svfycxzbfv\",\"containerId\":\"wvrvmtg\",\"ready\":true,\"started\":false,\"restartCount\":213302833,\"logStreamEndpoint\":\"ronzmyhgfip\",\"execEndpoint\":\"xkmcwaekrrjre\"},{\"name\":\"xt\",\"containerId\":\"umh\",\"ready\":false,\"started\":false,\"restartCount\":401545193,\"logStreamEndpoint\":\"slol\",\"execEndpoint\":\"pvuzlmv\"},{\"name\":\"lfktgplcrpwjxe\",\"containerId\":\"oi\",\"ready\":false,\"started\":true,\"restartCount\":509080980,\"logStreamEndpoint\":\"kpnb\",\"execEndpoint\":\"zejjoqk\"}]}") - .toObject(ReplicaProperties.class); - Assertions.assertEquals("hrixkwmy", model.containers().get(0).name()); - Assertions.assertEquals("ejvegrhbpnaixex", model.containers().get(0).containerId()); - Assertions.assertEquals(false, model.containers().get(0).ready()); - Assertions.assertEquals(true, model.containers().get(0).started()); - Assertions.assertEquals(303838192, model.containers().get(0).restartCount()); - } - - @Test - public void testSerialize() { - ReplicaProperties model = - new ReplicaProperties() - .withContainers( - Arrays - .asList( - new ReplicaContainer() - .withName("hrixkwmy") - .withContainerId("ejvegrhbpnaixex") - .withReady(false) - .withStarted(true) - .withRestartCount(303838192), - new ReplicaContainer() - .withName("svfycxzbfv") - .withContainerId("wvrvmtg") - .withReady(true) - .withStarted(false) - .withRestartCount(213302833), - new ReplicaContainer() - .withName("xt") - .withContainerId("umh") - .withReady(false) - .withStarted(false) - .withRestartCount(401545193), - new ReplicaContainer() - .withName("lfktgplcrpwjxe") - .withContainerId("oi") - .withReady(false) - .withStarted(true) - .withRestartCount(509080980))); - model = BinaryData.fromObject(model).toObject(ReplicaProperties.class); - Assertions.assertEquals("hrixkwmy", model.containers().get(0).name()); - Assertions.assertEquals("ejvegrhbpnaixex", model.containers().get(0).containerId()); - Assertions.assertEquals(false, model.containers().get(0).ready()); - Assertions.assertEquals(true, model.containers().get(0).started()); - Assertions.assertEquals(303838192, model.containers().get(0).restartCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionCollectionTests.java deleted file mode 100644 index a2f4ed6ce7286..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionCollectionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.RevisionInner; -import com.azure.resourcemanager.appcontainers.models.RevisionCollection; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class RevisionCollectionTests { - @Test - public void testDeserialize() { - RevisionCollection model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"createdTime\":\"2021-01-15T08:47:59Z\",\"lastActiveTime\":\"2021-05-14T06:41:01Z\",\"fqdn\":\"jabibsystawf\",\"active\":true,\"replicas\":591359047,\"trafficWeight\":226758731,\"provisioningError\":\"jxbkzbzkdvn\",\"healthState\":\"Healthy\",\"provisioningState\":\"Deprovisioned\"},\"id\":\"urgkakmokzhjjk\",\"name\":\"ffhmouwqlgzr\",\"type\":\"zeeyebi\"},{\"properties\":{\"createdTime\":\"2021-08-01T17:17:52Z\",\"lastActiveTime\":\"2021-02-02T12:35:30Z\",\"fqdn\":\"lbjbsyb\",\"active\":false,\"replicas\":146564330,\"trafficWeight\":1583288095,\"provisioningError\":\"mfpgv\",\"healthState\":\"None\",\"provisioningState\":\"Failed\"},\"id\":\"ltha\",\"name\":\"fxssm\",\"type\":\"u\"},{\"properties\":{\"createdTime\":\"2021-10-23T07:29:01Z\",\"lastActiveTime\":\"2021-01-02T11:55:22Z\",\"fqdn\":\"zpdrhneu\",\"active\":false,\"replicas\":150720980,\"trafficWeight\":2008248365,\"provisioningError\":\"i\",\"healthState\":\"None\",\"provisioningState\":\"Deprovisioned\"},\"id\":\"gpikpzimejza\",\"name\":\"lfzxiavrmbzonoki\",\"type\":\"rjqc\"}],\"nextLink\":\"gzpfrla\"}") - .toObject(RevisionCollection.class); - } - - @Test - public void testSerialize() { - RevisionCollection model = - new RevisionCollection() - .withValue(Arrays.asList(new RevisionInner(), new RevisionInner(), new RevisionInner())); - model = BinaryData.fromObject(model).toObject(RevisionCollection.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionInnerTests.java deleted file mode 100644 index 60e7b11ae21e8..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.RevisionInner; -import org.junit.jupiter.api.Test; - -public final class RevisionInnerTests { - @Test - public void testDeserialize() { - RevisionInner model = - BinaryData - .fromString( - "{\"properties\":{\"createdTime\":\"2021-07-24T19:53:33Z\",\"lastActiveTime\":\"2021-05-24T12:41:33Z\",\"fqdn\":\"iin\",\"template\":{\"revisionSuffix\":\"wp\",\"initContainers\":[],\"containers\":[],\"volumes\":[]},\"active\":false,\"replicas\":901371312,\"trafficWeight\":1612307116,\"provisioningError\":\"szfjvfbgofelja\",\"healthState\":\"None\",\"provisioningState\":\"Provisioned\"},\"id\":\"ldvriiiojnalghfk\",\"name\":\"tvsexsowuel\",\"type\":\"qhhahhxvrhmzkwpj\"}") - .toObject(RevisionInner.class); - } - - @Test - public void testSerialize() { - RevisionInner model = new RevisionInner(); - model = BinaryData.fromObject(model).toObject(RevisionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionPropertiesTests.java deleted file mode 100644 index 71cfc9d363a4e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/RevisionPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.RevisionProperties; -import org.junit.jupiter.api.Test; - -public final class RevisionPropertiesTests { - @Test - public void testDeserialize() { - RevisionProperties model = - BinaryData - .fromString( - "{\"createdTime\":\"2021-06-22T16:52:42Z\",\"lastActiveTime\":\"2021-08-18T23:10:34Z\",\"fqdn\":\"ghftqsxhqxujxuk\",\"template\":{\"revisionSuffix\":\"digrjguufzdmsyqt\",\"initContainers\":[{\"image\":\"hbotzingamvppho\",\"name\":\"qzudphq\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]},{\"image\":\"ynwcvtbv\",\"name\":\"yhmtnvyqiat\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]},{\"image\":\"wzcjaesgvvsccy\",\"name\":\"g\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]},{\"image\":\"zlvdnkfxusemdw\",\"name\":\"muhapfcqdpsqxqv\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]}],\"containers\":[{\"probes\":[],\"image\":\"elvezrypq\",\"name\":\"feo\",\"command\":[],\"args\":[],\"env\":[],\"volumeMounts\":[]}],\"scale\":{\"minReplicas\":137094818,\"maxReplicas\":1870547697,\"rules\":[]},\"volumes\":[{\"name\":\"dkow\",\"storageType\":\"AzureFile\",\"storageName\":\"pc\"}]},\"active\":false,\"replicas\":2091376747,\"trafficWeight\":2104767633,\"provisioningError\":\"njv\",\"healthState\":\"Healthy\",\"provisioningState\":\"Provisioning\"}") - .toObject(RevisionProperties.class); - } - - @Test - public void testSerialize() { - RevisionProperties model = new RevisionProperties(); - model = BinaryData.fromObject(model).toObject(RevisionProperties.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleRuleAuthTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleRuleAuthTests.java deleted file mode 100644 index fde8943776924..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleRuleAuthTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ScaleRuleAuth; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScaleRuleAuthTests { - @Test - public void testDeserialize() { - ScaleRuleAuth model = - BinaryData - .fromString("{\"secretRef\":\"gdknnqv\",\"triggerParameter\":\"znqntoru\"}") - .toObject(ScaleRuleAuth.class); - Assertions.assertEquals("gdknnqv", model.secretRef()); - Assertions.assertEquals("znqntoru", model.triggerParameter()); - } - - @Test - public void testSerialize() { - ScaleRuleAuth model = new ScaleRuleAuth().withSecretRef("gdknnqv").withTriggerParameter("znqntoru"); - model = BinaryData.fromObject(model).toObject(ScaleRuleAuth.class); - Assertions.assertEquals("gdknnqv", model.secretRef()); - Assertions.assertEquals("znqntoru", model.triggerParameter()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleRuleTests.java deleted file mode 100644 index ab65a2ea6cc8f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleRuleTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; -import com.azure.resourcemanager.appcontainers.models.HttpScaleRule; -import com.azure.resourcemanager.appcontainers.models.QueueScaleRule; -import com.azure.resourcemanager.appcontainers.models.ScaleRule; -import com.azure.resourcemanager.appcontainers.models.ScaleRuleAuth; -import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScaleRuleTests { - @Test - public void testDeserialize() { - ScaleRule model = - BinaryData - .fromString( - "{\"name\":\"ubeddg\",\"azureQueue\":{\"queueName\":\"fwqmzqalkrmn\",\"queueLength\":1174672424,\"auth\":[{\"secretRef\":\"cqqudf\",\"triggerParameter\":\"yxbaaabjyvayf\"},{\"secretRef\":\"m\",\"triggerParameter\":\"rtuzqogs\"},{\"secretRef\":\"nevfdnw\",\"triggerParameter\":\"mewzsyyc\"}]},\"custom\":{\"type\":\"soibjudpfrx\",\"metadata\":{\"ytdw\":\"hzv\",\"pdtii\":\"qbrqubpaxhexiili\",\"d\":\"q\",\"fxrxxle\":\"oaxoruzfgsqu\"},\"auth\":[{\"secretRef\":\"mxjezwlw\",\"triggerParameter\":\"xuqlcvydypat\"},{\"secretRef\":\"oa\",\"triggerParameter\":\"kniod\"},{\"secretRef\":\"oebwnujhemms\",\"triggerParameter\":\"dkcrodt\"}]},\"http\":{\"metadata\":{\"fltkacjv\":\"wj\"},\"auth\":[{\"secretRef\":\"lfoakg\",\"triggerParameter\":\"fpagaowpulp\"},{\"secretRef\":\"lyls\",\"triggerParameter\":\"k\"}]},\"tcp\":{\"metadata\":{\"xsdszuempsb\":\"jervtia\",\"v\":\"kfzbeyvpnqicvi\"},\"auth\":[{\"secretRef\":\"dxrbuukzcle\",\"triggerParameter\":\"hmlwpaztzpo\"},{\"secretRef\":\"cckwyfzqwhxxbu\",\"triggerParameter\":\"a\"},{\"secretRef\":\"feqztppriol\",\"triggerParameter\":\"rjaltolmncw\"}]}}") - .toObject(ScaleRule.class); - Assertions.assertEquals("ubeddg", model.name()); - Assertions.assertEquals("fwqmzqalkrmn", model.azureQueue().queueName()); - Assertions.assertEquals(1174672424, model.azureQueue().queueLength()); - Assertions.assertEquals("cqqudf", model.azureQueue().auth().get(0).secretRef()); - Assertions.assertEquals("yxbaaabjyvayf", model.azureQueue().auth().get(0).triggerParameter()); - Assertions.assertEquals("soibjudpfrx", model.custom().type()); - Assertions.assertEquals("hzv", model.custom().metadata().get("ytdw")); - Assertions.assertEquals("mxjezwlw", model.custom().auth().get(0).secretRef()); - Assertions.assertEquals("xuqlcvydypat", model.custom().auth().get(0).triggerParameter()); - Assertions.assertEquals("wj", model.http().metadata().get("fltkacjv")); - Assertions.assertEquals("lfoakg", model.http().auth().get(0).secretRef()); - Assertions.assertEquals("fpagaowpulp", model.http().auth().get(0).triggerParameter()); - Assertions.assertEquals("jervtia", model.tcp().metadata().get("xsdszuempsb")); - Assertions.assertEquals("dxrbuukzcle", model.tcp().auth().get(0).secretRef()); - Assertions.assertEquals("hmlwpaztzpo", model.tcp().auth().get(0).triggerParameter()); - } - - @Test - public void testSerialize() { - ScaleRule model = - new ScaleRule() - .withName("ubeddg") - .withAzureQueue( - new QueueScaleRule() - .withQueueName("fwqmzqalkrmn") - .withQueueLength(1174672424) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("cqqudf").withTriggerParameter("yxbaaabjyvayf"), - new ScaleRuleAuth().withSecretRef("m").withTriggerParameter("rtuzqogs"), - new ScaleRuleAuth().withSecretRef("nevfdnw").withTriggerParameter("mewzsyyc")))) - .withCustom( - new CustomScaleRule() - .withType("soibjudpfrx") - .withMetadata( - mapOf("ytdw", "hzv", "pdtii", "qbrqubpaxhexiili", "d", "q", "fxrxxle", "oaxoruzfgsqu")) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("mxjezwlw").withTriggerParameter("xuqlcvydypat"), - new ScaleRuleAuth().withSecretRef("oa").withTriggerParameter("kniod"), - new ScaleRuleAuth().withSecretRef("oebwnujhemms").withTriggerParameter("dkcrodt")))) - .withHttp( - new HttpScaleRule() - .withMetadata(mapOf("fltkacjv", "wj")) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("lfoakg").withTriggerParameter("fpagaowpulp"), - new ScaleRuleAuth().withSecretRef("lyls").withTriggerParameter("k")))) - .withTcp( - new TcpScaleRule() - .withMetadata(mapOf("xsdszuempsb", "jervtia", "v", "kfzbeyvpnqicvi")) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth() - .withSecretRef("dxrbuukzcle") - .withTriggerParameter("hmlwpaztzpo"), - new ScaleRuleAuth().withSecretRef("cckwyfzqwhxxbu").withTriggerParameter("a"), - new ScaleRuleAuth() - .withSecretRef("feqztppriol") - .withTriggerParameter("rjaltolmncw")))); - model = BinaryData.fromObject(model).toObject(ScaleRule.class); - Assertions.assertEquals("ubeddg", model.name()); - Assertions.assertEquals("fwqmzqalkrmn", model.azureQueue().queueName()); - Assertions.assertEquals(1174672424, model.azureQueue().queueLength()); - Assertions.assertEquals("cqqudf", model.azureQueue().auth().get(0).secretRef()); - Assertions.assertEquals("yxbaaabjyvayf", model.azureQueue().auth().get(0).triggerParameter()); - Assertions.assertEquals("soibjudpfrx", model.custom().type()); - Assertions.assertEquals("hzv", model.custom().metadata().get("ytdw")); - Assertions.assertEquals("mxjezwlw", model.custom().auth().get(0).secretRef()); - Assertions.assertEquals("xuqlcvydypat", model.custom().auth().get(0).triggerParameter()); - Assertions.assertEquals("wj", model.http().metadata().get("fltkacjv")); - Assertions.assertEquals("lfoakg", model.http().auth().get(0).secretRef()); - Assertions.assertEquals("fpagaowpulp", model.http().auth().get(0).triggerParameter()); - Assertions.assertEquals("jervtia", model.tcp().metadata().get("xsdszuempsb")); - Assertions.assertEquals("dxrbuukzcle", model.tcp().auth().get(0).secretRef()); - Assertions.assertEquals("hmlwpaztzpo", model.tcp().auth().get(0).triggerParameter()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleTests.java deleted file mode 100644 index 704b38964089e..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/ScaleTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.CustomScaleRule; -import com.azure.resourcemanager.appcontainers.models.HttpScaleRule; -import com.azure.resourcemanager.appcontainers.models.QueueScaleRule; -import com.azure.resourcemanager.appcontainers.models.Scale; -import com.azure.resourcemanager.appcontainers.models.ScaleRule; -import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class ScaleTests { - @Test - public void testDeserialize() { - Scale model = - BinaryData - .fromString( - "{\"minReplicas\":277220596,\"maxReplicas\":1475802306,\"rules\":[{\"name\":\"pxllrx\",\"azureQueue\":{\"queueName\":\"moadsuvarmy\",\"queueLength\":1450729079,\"auth\":[]},\"custom\":{\"type\":\"q\",\"metadata\":{},\"auth\":[]},\"http\":{\"metadata\":{},\"auth\":[]},\"tcp\":{\"metadata\":{},\"auth\":[]}},{\"name\":\"yc\",\"azureQueue\":{\"queueName\":\"hp\",\"queueLength\":1622537719,\"auth\":[]},\"custom\":{\"type\":\"areqna\",\"metadata\":{},\"auth\":[]},\"http\":{\"metadata\":{},\"auth\":[]},\"tcp\":{\"metadata\":{},\"auth\":[]}}]}") - .toObject(Scale.class); - Assertions.assertEquals(277220596, model.minReplicas()); - Assertions.assertEquals(1475802306, model.maxReplicas()); - Assertions.assertEquals("pxllrx", model.rules().get(0).name()); - Assertions.assertEquals("moadsuvarmy", model.rules().get(0).azureQueue().queueName()); - Assertions.assertEquals(1450729079, model.rules().get(0).azureQueue().queueLength()); - Assertions.assertEquals("q", model.rules().get(0).custom().type()); - } - - @Test - public void testSerialize() { - Scale model = - new Scale() - .withMinReplicas(277220596) - .withMaxReplicas(1475802306) - .withRules( - Arrays - .asList( - new ScaleRule() - .withName("pxllrx") - .withAzureQueue( - new QueueScaleRule() - .withQueueName("moadsuvarmy") - .withQueueLength(1450729079) - .withAuth(Arrays.asList())) - .withCustom( - new CustomScaleRule().withType("q").withMetadata(mapOf()).withAuth(Arrays.asList())) - .withHttp(new HttpScaleRule().withMetadata(mapOf()).withAuth(Arrays.asList())) - .withTcp(new TcpScaleRule().withMetadata(mapOf()).withAuth(Arrays.asList())), - new ScaleRule() - .withName("yc") - .withAzureQueue( - new QueueScaleRule() - .withQueueName("hp") - .withQueueLength(1622537719) - .withAuth(Arrays.asList())) - .withCustom( - new CustomScaleRule() - .withType("areqna") - .withMetadata(mapOf()) - .withAuth(Arrays.asList())) - .withHttp(new HttpScaleRule().withMetadata(mapOf()).withAuth(Arrays.asList())) - .withTcp(new TcpScaleRule().withMetadata(mapOf()).withAuth(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(Scale.class); - Assertions.assertEquals(277220596, model.minReplicas()); - Assertions.assertEquals(1475802306, model.maxReplicas()); - Assertions.assertEquals("pxllrx", model.rules().get(0).name()); - Assertions.assertEquals("moadsuvarmy", model.rules().get(0).azureQueue().queueName()); - Assertions.assertEquals(1450729079, model.rules().get(0).azureQueue().queueLength()); - Assertions.assertEquals("q", model.rules().get(0).custom().type()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SecretTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SecretTests.java deleted file mode 100644 index f50d916afccb9..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SecretTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Secret; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SecretTests { - @Test - public void testDeserialize() { - Secret model = BinaryData.fromString("{\"name\":\"k\",\"value\":\"ali\"}").toObject(Secret.class); - Assertions.assertEquals("k", model.name()); - Assertions.assertEquals("ali", model.value()); - } - - @Test - public void testSerialize() { - Secret model = new Secret().withName("k").withValue("ali"); - model = BinaryData.fromObject(model).toObject(Secret.class); - Assertions.assertEquals("k", model.name()); - Assertions.assertEquals("ali", model.value()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SecretsCollectionInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SecretsCollectionInnerTests.java deleted file mode 100644 index 728c1021123f6..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SecretsCollectionInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.SecretsCollectionInner; -import com.azure.resourcemanager.appcontainers.models.ContainerAppSecret; -import java.util.Arrays; -import org.junit.jupiter.api.Test; - -public final class SecretsCollectionInnerTests { - @Test - public void testDeserialize() { - SecretsCollectionInner model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"racstwity\",\"value\":\"evxccedcp\"},{\"name\":\"dyodnwzxltj\",\"value\":\"nhltiugcxn\"},{\"name\":\"vwxqibyqunyo\",\"value\":\"wlmdjrkv\"},{\"name\":\"bvfvpdbod\",\"value\":\"izsjqlhkrr\"}]}") - .toObject(SecretsCollectionInner.class); - } - - @Test - public void testSerialize() { - SecretsCollectionInner model = - new SecretsCollectionInner() - .withValue( - Arrays - .asList( - new ContainerAppSecret(), - new ContainerAppSecret(), - new ContainerAppSecret(), - new ContainerAppSecret())); - model = BinaryData.fromObject(model).toObject(SecretsCollectionInner.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SourceControlCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SourceControlCollectionTests.java deleted file mode 100644 index ca43891e15c8f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SourceControlCollectionTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.SourceControlInner; -import com.azure.resourcemanager.appcontainers.models.SourceControlCollection; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SourceControlCollectionTests { - @Test - public void testDeserialize() { - SourceControlCollection model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"operationState\":\"Canceled\",\"repoUrl\":\"mtggu\",\"branch\":\"ijr\"},\"id\":\"ivmmghfcfiwrxgk\",\"name\":\"euvyinzqodfvpgs\",\"type\":\"oxgsgbpfgzdjtx\"},{\"properties\":{\"operationState\":\"Canceled\",\"repoUrl\":\"q\",\"branch\":\"aqvlgafcqusr\"},\"id\":\"t\",\"name\":\"wsdtutnwl\",\"type\":\"uycvuzhyrmewip\"},{\"properties\":{\"operationState\":\"InProgress\",\"repoUrl\":\"xukuqgsj\",\"branch\":\"undxgketw\"},\"id\":\"zjhfjmhvv\",\"name\":\"uvgp\",\"type\":\"uneqsxvmhf\"},{\"properties\":{\"operationState\":\"Canceled\",\"repoUrl\":\"ihsasb\",\"branch\":\"dyp\"},\"id\":\"uemsly\",\"name\":\"sqy\",\"type\":\"pfoobr\"}],\"nextLink\":\"tyms\"}") - .toObject(SourceControlCollection.class); - Assertions.assertEquals("mtggu", model.value().get(0).repoUrl()); - Assertions.assertEquals("ijr", model.value().get(0).branch()); - } - - @Test - public void testSerialize() { - SourceControlCollection model = - new SourceControlCollection() - .withValue( - Arrays - .asList( - new SourceControlInner().withRepoUrl("mtggu").withBranch("ijr"), - new SourceControlInner().withRepoUrl("q").withBranch("aqvlgafcqusr"), - new SourceControlInner().withRepoUrl("xukuqgsj").withBranch("undxgketw"), - new SourceControlInner().withRepoUrl("ihsasb").withBranch("dyp"))); - model = BinaryData.fromObject(model).toObject(SourceControlCollection.class); - Assertions.assertEquals("mtggu", model.value().get(0).repoUrl()); - Assertions.assertEquals("ijr", model.value().get(0).branch()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SourceControlInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SourceControlInnerTests.java deleted file mode 100644 index dfd718e91ff0c..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/SourceControlInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.SourceControlInner; -import com.azure.resourcemanager.appcontainers.models.GithubActionConfiguration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class SourceControlInnerTests { - @Test - public void testDeserialize() { - SourceControlInner model = - BinaryData - .fromString( - "{\"properties\":{\"operationState\":\"Failed\",\"repoUrl\":\"dnfwqzdzg\",\"branch\":\"la\",\"githubActionConfiguration\":{\"contextPath\":\"qlyvijo\",\"image\":\"iv\",\"publishType\":\"oyzunbixxr\",\"os\":\"kvcpwpgclr\",\"runtimeStack\":\"vtsoxf\",\"runtimeVersion\":\"enxpmyyefr\"}},\"id\":\"pdnqqskawaoqvmmb\",\"name\":\"pqfrtqlkz\",\"type\":\"egnitg\"}") - .toObject(SourceControlInner.class); - Assertions.assertEquals("dnfwqzdzg", model.repoUrl()); - Assertions.assertEquals("la", model.branch()); - Assertions.assertEquals("qlyvijo", model.githubActionConfiguration().contextPath()); - Assertions.assertEquals("iv", model.githubActionConfiguration().image()); - Assertions.assertEquals("oyzunbixxr", model.githubActionConfiguration().publishType()); - Assertions.assertEquals("kvcpwpgclr", model.githubActionConfiguration().os()); - Assertions.assertEquals("vtsoxf", model.githubActionConfiguration().runtimeStack()); - Assertions.assertEquals("enxpmyyefr", model.githubActionConfiguration().runtimeVersion()); - } - - @Test - public void testSerialize() { - SourceControlInner model = - new SourceControlInner() - .withRepoUrl("dnfwqzdzg") - .withBranch("la") - .withGithubActionConfiguration( - new GithubActionConfiguration() - .withContextPath("qlyvijo") - .withImage("iv") - .withPublishType("oyzunbixxr") - .withOs("kvcpwpgclr") - .withRuntimeStack("vtsoxf") - .withRuntimeVersion("enxpmyyefr")); - model = BinaryData.fromObject(model).toObject(SourceControlInner.class); - Assertions.assertEquals("dnfwqzdzg", model.repoUrl()); - Assertions.assertEquals("la", model.branch()); - Assertions.assertEquals("qlyvijo", model.githubActionConfiguration().contextPath()); - Assertions.assertEquals("iv", model.githubActionConfiguration().image()); - Assertions.assertEquals("oyzunbixxr", model.githubActionConfiguration().publishType()); - Assertions.assertEquals("kvcpwpgclr", model.githubActionConfiguration().os()); - Assertions.assertEquals("vtsoxf", model.githubActionConfiguration().runtimeStack()); - Assertions.assertEquals("enxpmyyefr", model.githubActionConfiguration().runtimeVersion()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TcpScaleRuleTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TcpScaleRuleTests.java deleted file mode 100644 index d62489c363d6a..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TcpScaleRuleTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ScaleRuleAuth; -import com.azure.resourcemanager.appcontainers.models.TcpScaleRule; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TcpScaleRuleTests { - @Test - public void testDeserialize() { - TcpScaleRule model = - BinaryData - .fromString( - "{\"metadata\":{\"twaenuuzko\":\"ufgmjzrwrdg\",\"iefozbhdmsml\":\"bminrfdwoyuhhzi\"},\"auth\":[{\"secretRef\":\"oftrmaequia\",\"triggerParameter\":\"icslfaoq\"},{\"secretRef\":\"iyylhalnswhccsp\",\"triggerParameter\":\"aivwitqscywu\"},{\"secretRef\":\"woluhczbwemhair\",\"triggerParameter\":\"rgzdwmsweyp\"},{\"secretRef\":\"dxggicccnxqhuexm\",\"triggerParameter\":\"tlstvlzywem\"}]}") - .toObject(TcpScaleRule.class); - Assertions.assertEquals("ufgmjzrwrdg", model.metadata().get("twaenuuzko")); - Assertions.assertEquals("oftrmaequia", model.auth().get(0).secretRef()); - Assertions.assertEquals("icslfaoq", model.auth().get(0).triggerParameter()); - } - - @Test - public void testSerialize() { - TcpScaleRule model = - new TcpScaleRule() - .withMetadata(mapOf("twaenuuzko", "ufgmjzrwrdg", "iefozbhdmsml", "bminrfdwoyuhhzi")) - .withAuth( - Arrays - .asList( - new ScaleRuleAuth().withSecretRef("oftrmaequia").withTriggerParameter("icslfaoq"), - new ScaleRuleAuth().withSecretRef("iyylhalnswhccsp").withTriggerParameter("aivwitqscywu"), - new ScaleRuleAuth().withSecretRef("woluhczbwemhair").withTriggerParameter("rgzdwmsweyp"), - new ScaleRuleAuth().withSecretRef("dxggicccnxqhuexm").withTriggerParameter("tlstvlzywem"))); - model = BinaryData.fromObject(model).toObject(TcpScaleRule.class); - Assertions.assertEquals("ufgmjzrwrdg", model.metadata().get("twaenuuzko")); - Assertions.assertEquals("oftrmaequia", model.auth().get(0).secretRef()); - Assertions.assertEquals("icslfaoq", model.auth().get(0).triggerParameter()); - } - - @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/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TemplateTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TemplateTests.java deleted file mode 100644 index 4343123445bd2..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TemplateTests.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.Container; -import com.azure.resourcemanager.appcontainers.models.ContainerResources; -import com.azure.resourcemanager.appcontainers.models.InitContainer; -import com.azure.resourcemanager.appcontainers.models.Scale; -import com.azure.resourcemanager.appcontainers.models.ScaleRule; -import com.azure.resourcemanager.appcontainers.models.StorageType; -import com.azure.resourcemanager.appcontainers.models.Template; -import com.azure.resourcemanager.appcontainers.models.Volume; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TemplateTests { - @Test - public void testDeserialize() { - Template model = - BinaryData - .fromString( - "{\"revisionSuffix\":\"mcqibycnojv\",\"initContainers\":[{\"image\":\"fqsgzvahapjy\",\"name\":\"pvgqzcjrvxdjzlm\",\"command\":[\"kvugfhzovawjvzun\",\"uthnnprnxipeilpj\",\"uaejxdultsk\"],\"args\":[\"tdzumveekgpw\",\"zuhkfpbsjyof\",\"xl\"],\"env\":[],\"resources\":{\"cpu\":63.45978205100479,\"memory\":\"waboe\",\"ephemeralStorage\":\"v\"},\"volumeMounts\":[]},{\"image\":\"smv\",\"name\":\"wyjsflhhcaalnjix\",\"command\":[\"yaw\",\"oyaqcslyjpkiid\"],\"args\":[\"xznelixhnrztf\",\"lhbnxkna\",\"aulppggd\"],\"env\":[],\"resources\":{\"cpu\":62.44640700433306,\"memory\":\"ropuhpigv\",\"ephemeralStorage\":\"ylgqgitxmedjvcsl\"},\"volumeMounts\":[]},{\"image\":\"wncwzzhxgktrmg\",\"name\":\"napkteoellw\",\"command\":[\"d\",\"gpfqbuace\",\"pzfqrhhuaoppp\",\"qeqxo\"],\"args\":[\"ahzxctobgbk\",\"moizpos\",\"mgrcfbu\"],\"env\":[],\"resources\":{\"cpu\":39.820918987867984,\"memory\":\"kxbpvj\",\"ephemeralStorage\":\"jhxxjyn\"},\"volumeMounts\":[]},{\"image\":\"vkr\",\"name\":\"wbxqzvszjfau\",\"command\":[\"dxxiv\",\"tvtc\",\"aqtdoqmcbx\",\"wvxysl\"],\"args\":[\"sfxobl\",\"tkblmpewww\",\"bkrvrnsvshqj\"],\"env\":[],\"resources\":{\"cpu\":26.217415829732616,\"memory\":\"ovasrruvwbhsqfsu\",\"ephemeralStorage\":\"gjb\"},\"volumeMounts\":[]}],\"containers\":[{\"probes\":[],\"image\":\"rfbjf\",\"name\":\"w\",\"command\":[\"t\",\"tpvjzbexilzznfqq\",\"vwpm\",\"taruoujmkcj\"],\"args\":[\"ytjrybnwjewgdr\",\"ervnaenqpehi\",\"doy\",\"mifthnzdnd\"],\"env\":[],\"resources\":{\"cpu\":9.874823960807245,\"memory\":\"gynduha\",\"ephemeralStorage\":\"qlkth\"},\"volumeMounts\":[]},{\"probes\":[],\"image\":\"bgycduiertgccym\",\"name\":\"olpsslqlf\",\"command\":[\"n\",\"bglzpswi\",\"d\"],\"args\":[\"yhz\",\"xssadbzmnvdf\"],\"env\":[],\"resources\":{\"cpu\":6.678154863771269,\"memory\":\"xzb\",\"ephemeralStorage\":\"blylpstdbh\"},\"volumeMounts\":[]},{\"probes\":[],\"image\":\"zucerscdntnev\",\"name\":\"wjmy\",\"command\":[\"sslswtmweriof\",\"pyqs\"],\"args\":[\"abnetshh\"],\"env\":[],\"resources\":{\"cpu\":83.1289050402311,\"memory\":\"wiwubm\",\"ephemeralStorage\":\"besldnkwwtppjflc\"},\"volumeMounts\":[]}],\"scale\":{\"minReplicas\":97204853,\"maxReplicas\":244687825,\"rules\":[{\"name\":\"sikvmkqzeqqkdlt\"}]},\"volumes\":[{\"name\":\"gureodkwobdag\",\"storageType\":\"EmptyDir\",\"storageName\":\"qdxbxwa\"}]}") - .toObject(Template.class); - Assertions.assertEquals("mcqibycnojv", model.revisionSuffix()); - Assertions.assertEquals("fqsgzvahapjy", model.initContainers().get(0).image()); - Assertions.assertEquals("pvgqzcjrvxdjzlm", model.initContainers().get(0).name()); - Assertions.assertEquals("kvugfhzovawjvzun", model.initContainers().get(0).command().get(0)); - Assertions.assertEquals("tdzumveekgpw", model.initContainers().get(0).args().get(0)); - Assertions.assertEquals(63.45978205100479D, model.initContainers().get(0).resources().cpu()); - Assertions.assertEquals("waboe", model.initContainers().get(0).resources().memory()); - Assertions.assertEquals("rfbjf", model.containers().get(0).image()); - Assertions.assertEquals("w", model.containers().get(0).name()); - Assertions.assertEquals("t", model.containers().get(0).command().get(0)); - Assertions.assertEquals("ytjrybnwjewgdr", model.containers().get(0).args().get(0)); - Assertions.assertEquals(9.874823960807245D, model.containers().get(0).resources().cpu()); - Assertions.assertEquals("gynduha", model.containers().get(0).resources().memory()); - Assertions.assertEquals(97204853, model.scale().minReplicas()); - Assertions.assertEquals(244687825, model.scale().maxReplicas()); - Assertions.assertEquals("sikvmkqzeqqkdlt", model.scale().rules().get(0).name()); - Assertions.assertEquals("gureodkwobdag", model.volumes().get(0).name()); - Assertions.assertEquals(StorageType.EMPTY_DIR, model.volumes().get(0).storageType()); - Assertions.assertEquals("qdxbxwa", model.volumes().get(0).storageName()); - } - - @Test - public void testSerialize() { - Template model = - new Template() - .withRevisionSuffix("mcqibycnojv") - .withInitContainers( - Arrays - .asList( - new InitContainer() - .withImage("fqsgzvahapjy") - .withName("pvgqzcjrvxdjzlm") - .withCommand(Arrays.asList("kvugfhzovawjvzun", "uthnnprnxipeilpj", "uaejxdultsk")) - .withArgs(Arrays.asList("tdzumveekgpw", "zuhkfpbsjyof", "xl")) - .withEnv(Arrays.asList()) - .withResources(new ContainerResources().withCpu(63.45978205100479D).withMemory("waboe")) - .withVolumeMounts(Arrays.asList()), - new InitContainer() - .withImage("smv") - .withName("wyjsflhhcaalnjix") - .withCommand(Arrays.asList("yaw", "oyaqcslyjpkiid")) - .withArgs(Arrays.asList("xznelixhnrztf", "lhbnxkna", "aulppggd")) - .withEnv(Arrays.asList()) - .withResources( - new ContainerResources().withCpu(62.44640700433306D).withMemory("ropuhpigv")) - .withVolumeMounts(Arrays.asList()), - new InitContainer() - .withImage("wncwzzhxgktrmg") - .withName("napkteoellw") - .withCommand(Arrays.asList("d", "gpfqbuace", "pzfqrhhuaoppp", "qeqxo")) - .withArgs(Arrays.asList("ahzxctobgbk", "moizpos", "mgrcfbu")) - .withEnv(Arrays.asList()) - .withResources( - new ContainerResources().withCpu(39.820918987867984D).withMemory("kxbpvj")) - .withVolumeMounts(Arrays.asList()), - new InitContainer() - .withImage("vkr") - .withName("wbxqzvszjfau") - .withCommand(Arrays.asList("dxxiv", "tvtc", "aqtdoqmcbx", "wvxysl")) - .withArgs(Arrays.asList("sfxobl", "tkblmpewww", "bkrvrnsvshqj")) - .withEnv(Arrays.asList()) - .withResources( - new ContainerResources() - .withCpu(26.217415829732616D) - .withMemory("ovasrruvwbhsqfsu")) - .withVolumeMounts(Arrays.asList()))) - .withContainers( - Arrays - .asList( - new Container() - .withImage("rfbjf") - .withName("w") - .withCommand(Arrays.asList("t", "tpvjzbexilzznfqq", "vwpm", "taruoujmkcj")) - .withArgs(Arrays.asList("ytjrybnwjewgdr", "ervnaenqpehi", "doy", "mifthnzdnd")) - .withEnv(Arrays.asList()) - .withResources( - new ContainerResources().withCpu(9.874823960807245D).withMemory("gynduha")) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()), - new Container() - .withImage("bgycduiertgccym") - .withName("olpsslqlf") - .withCommand(Arrays.asList("n", "bglzpswi", "d")) - .withArgs(Arrays.asList("yhz", "xssadbzmnvdf")) - .withEnv(Arrays.asList()) - .withResources(new ContainerResources().withCpu(6.678154863771269D).withMemory("xzb")) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()), - new Container() - .withImage("zucerscdntnev") - .withName("wjmy") - .withCommand(Arrays.asList("sslswtmweriof", "pyqs")) - .withArgs(Arrays.asList("abnetshh")) - .withEnv(Arrays.asList()) - .withResources(new ContainerResources().withCpu(83.1289050402311D).withMemory("wiwubm")) - .withVolumeMounts(Arrays.asList()) - .withProbes(Arrays.asList()))) - .withScale( - new Scale() - .withMinReplicas(97204853) - .withMaxReplicas(244687825) - .withRules(Arrays.asList(new ScaleRule().withName("sikvmkqzeqqkdlt")))) - .withVolumes( - Arrays - .asList( - new Volume() - .withName("gureodkwobdag") - .withStorageType(StorageType.EMPTY_DIR) - .withStorageName("qdxbxwa"))); - model = BinaryData.fromObject(model).toObject(Template.class); - Assertions.assertEquals("mcqibycnojv", model.revisionSuffix()); - Assertions.assertEquals("fqsgzvahapjy", model.initContainers().get(0).image()); - Assertions.assertEquals("pvgqzcjrvxdjzlm", model.initContainers().get(0).name()); - Assertions.assertEquals("kvugfhzovawjvzun", model.initContainers().get(0).command().get(0)); - Assertions.assertEquals("tdzumveekgpw", model.initContainers().get(0).args().get(0)); - Assertions.assertEquals(63.45978205100479D, model.initContainers().get(0).resources().cpu()); - Assertions.assertEquals("waboe", model.initContainers().get(0).resources().memory()); - Assertions.assertEquals("rfbjf", model.containers().get(0).image()); - Assertions.assertEquals("w", model.containers().get(0).name()); - Assertions.assertEquals("t", model.containers().get(0).command().get(0)); - Assertions.assertEquals("ytjrybnwjewgdr", model.containers().get(0).args().get(0)); - Assertions.assertEquals(9.874823960807245D, model.containers().get(0).resources().cpu()); - Assertions.assertEquals("gynduha", model.containers().get(0).resources().memory()); - Assertions.assertEquals(97204853, model.scale().minReplicas()); - Assertions.assertEquals(244687825, model.scale().maxReplicas()); - Assertions.assertEquals("sikvmkqzeqqkdlt", model.scale().rules().get(0).name()); - Assertions.assertEquals("gureodkwobdag", model.volumes().get(0).name()); - Assertions.assertEquals(StorageType.EMPTY_DIR, model.volumes().get(0).storageType()); - Assertions.assertEquals("qdxbxwa", model.volumes().get(0).storageName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TrafficWeightTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TrafficWeightTests.java deleted file mode 100644 index 49d809a3ba2fb..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/TrafficWeightTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.TrafficWeight; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class TrafficWeightTests { - @Test - public void testDeserialize() { - TrafficWeight model = - BinaryData - .fromString( - "{\"revisionName\":\"nbmpowuwprzq\",\"weight\":706936275,\"latestRevision\":false,\"label\":\"upjm\"}") - .toObject(TrafficWeight.class); - Assertions.assertEquals("nbmpowuwprzq", model.revisionName()); - Assertions.assertEquals(706936275, model.weight()); - Assertions.assertEquals(false, model.latestRevision()); - Assertions.assertEquals("upjm", model.label()); - } - - @Test - public void testSerialize() { - TrafficWeight model = - new TrafficWeight() - .withRevisionName("nbmpowuwprzq") - .withWeight(706936275) - .withLatestRevision(false) - .withLabel("upjm"); - model = BinaryData.fromObject(model).toObject(TrafficWeight.class); - Assertions.assertEquals("nbmpowuwprzq", model.revisionName()); - Assertions.assertEquals(706936275, model.weight()); - Assertions.assertEquals(false, model.latestRevision()); - Assertions.assertEquals("upjm", model.label()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UserAssignedIdentityTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 1633158b2f51d..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.UserAssignedIdentity; -import org.junit.jupiter.api.Test; - -public final class UserAssignedIdentityTests { - @Test - public void testDeserialize() { - UserAssignedIdentity model = BinaryData.fromString("{}").toObject(UserAssignedIdentity.class); - } - - @Test - public void testSerialize() { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConfigurationTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConfigurationTests.java deleted file mode 100644 index 7da57ae8a6d66..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VnetConfigurationTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutBoundType; -import com.azure.resourcemanager.appcontainers.models.ManagedEnvironmentOutboundSettings; -import com.azure.resourcemanager.appcontainers.models.VnetConfiguration; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VnetConfigurationTests { - @Test - public void testDeserialize() { - VnetConfiguration model = - BinaryData - .fromString( - "{\"internal\":true,\"infrastructureSubnetId\":\"er\",\"runtimeSubnetId\":\"pqbmfpjbab\",\"dockerBridgeCidr\":\"dfc\",\"platformReservedCidr\":\"spuunnoxyhkxgq\",\"platformReservedDnsIP\":\"rihpfhoq\",\"outboundSettings\":{\"outBoundType\":\"LoadBalancer\",\"virtualNetworkApplianceIp\":\"dao\"}}") - .toObject(VnetConfiguration.class); - Assertions.assertEquals(true, model.internal()); - Assertions.assertEquals("er", model.infrastructureSubnetId()); - Assertions.assertEquals("pqbmfpjbab", model.runtimeSubnetId()); - Assertions.assertEquals("dfc", model.dockerBridgeCidr()); - Assertions.assertEquals("spuunnoxyhkxgq", model.platformReservedCidr()); - Assertions.assertEquals("rihpfhoq", model.platformReservedDnsIp()); - Assertions.assertEquals(ManagedEnvironmentOutBoundType.LOAD_BALANCER, model.outboundSettings().outBoundType()); - Assertions.assertEquals("dao", model.outboundSettings().virtualNetworkApplianceIp()); - } - - @Test - public void testSerialize() { - VnetConfiguration model = - new VnetConfiguration() - .withInternal(true) - .withInfrastructureSubnetId("er") - .withRuntimeSubnetId("pqbmfpjbab") - .withDockerBridgeCidr("dfc") - .withPlatformReservedCidr("spuunnoxyhkxgq") - .withPlatformReservedDnsIp("rihpfhoq") - .withOutboundSettings( - new ManagedEnvironmentOutboundSettings() - .withOutBoundType(ManagedEnvironmentOutBoundType.LOAD_BALANCER) - .withVirtualNetworkApplianceIp("dao")); - model = BinaryData.fromObject(model).toObject(VnetConfiguration.class); - Assertions.assertEquals(true, model.internal()); - Assertions.assertEquals("er", model.infrastructureSubnetId()); - Assertions.assertEquals("pqbmfpjbab", model.runtimeSubnetId()); - Assertions.assertEquals("dfc", model.dockerBridgeCidr()); - Assertions.assertEquals("spuunnoxyhkxgq", model.platformReservedCidr()); - Assertions.assertEquals("rihpfhoq", model.platformReservedDnsIp()); - Assertions.assertEquals(ManagedEnvironmentOutBoundType.LOAD_BALANCER, model.outboundSettings().outBoundType()); - Assertions.assertEquals("dao", model.outboundSettings().virtualNetworkApplianceIp()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeMountTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeMountTests.java deleted file mode 100644 index eb336740d6195..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeMountTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.VolumeMount; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeMountTests { - @Test - public void testDeserialize() { - VolumeMount model = - BinaryData - .fromString("{\"volumeName\":\"btkuwhh\",\"mountPath\":\"ykojoxafnndlpic\"}") - .toObject(VolumeMount.class); - Assertions.assertEquals("btkuwhh", model.volumeName()); - Assertions.assertEquals("ykojoxafnndlpic", model.mountPath()); - } - - @Test - public void testSerialize() { - VolumeMount model = new VolumeMount().withVolumeName("btkuwhh").withMountPath("ykojoxafnndlpic"); - model = BinaryData.fromObject(model).toObject(VolumeMount.class); - Assertions.assertEquals("btkuwhh", model.volumeName()); - Assertions.assertEquals("ykojoxafnndlpic", model.mountPath()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeTests.java deleted file mode 100644 index c384f073f8b2f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/VolumeTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.StorageType; -import com.azure.resourcemanager.appcontainers.models.Volume; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class VolumeTests { - @Test - public void testDeserialize() { - Volume model = - BinaryData - .fromString("{\"name\":\"rncsdtclu\",\"storageType\":\"EmptyDir\",\"storageName\":\"bsfgytguslfea\"}") - .toObject(Volume.class); - Assertions.assertEquals("rncsdtclu", model.name()); - Assertions.assertEquals(StorageType.EMPTY_DIR, model.storageType()); - Assertions.assertEquals("bsfgytguslfea", model.storageName()); - } - - @Test - public void testSerialize() { - Volume model = - new Volume().withName("rncsdtclu").withStorageType(StorageType.EMPTY_DIR).withStorageName("bsfgytguslfea"); - model = BinaryData.fromObject(model).toObject(Volume.class); - Assertions.assertEquals("rncsdtclu", model.name()); - Assertions.assertEquals(StorageType.EMPTY_DIR, model.storageType()); - Assertions.assertEquals("bsfgytguslfea", model.storageName()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesCollectionTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesCollectionTests.java deleted file mode 100644 index dd61687caefa1..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesCollectionTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesCollection; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkloadProfileStatesCollectionTests { - @Test - public void testDeserialize() { - WorkloadProfileStatesCollection model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"minimumCount\":1215063805,\"maximumCount\":1612515115,\"currentCount\":75239046},\"id\":\"metttwgd\",\"name\":\"lqxihhrmooiz\",\"type\":\"seypxiutcxapz\"}],\"nextLink\":\"rpetogebjoxsl\"}") - .toObject(WorkloadProfileStatesCollection.class); - Assertions.assertEquals(1215063805, model.value().get(0).properties().minimumCount()); - Assertions.assertEquals(1612515115, model.value().get(0).properties().maximumCount()); - Assertions.assertEquals(75239046, model.value().get(0).properties().currentCount()); - } - - @Test - public void testSerialize() { - WorkloadProfileStatesCollection model = - new WorkloadProfileStatesCollection() - .withValue( - Arrays - .asList( - new WorkloadProfileStatesInner() - .withProperties( - new WorkloadProfileStatesProperties() - .withMinimumCount(1215063805) - .withMaximumCount(1612515115) - .withCurrentCount(75239046)))); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesCollection.class); - Assertions.assertEquals(1215063805, model.value().get(0).properties().minimumCount()); - Assertions.assertEquals(1612515115, model.value().get(0).properties().maximumCount()); - Assertions.assertEquals(75239046, model.value().get(0).properties().currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesInnerTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesInnerTests.java deleted file mode 100644 index 6ae23c1eb328f..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.fluent.models.WorkloadProfileStatesInner; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkloadProfileStatesInnerTests { - @Test - public void testDeserialize() { - WorkloadProfileStatesInner model = - BinaryData - .fromString( - "{\"properties\":{\"minimumCount\":1522179907,\"maximumCount\":255034362,\"currentCount\":1064191938},\"id\":\"nk\",\"name\":\"zjcjbtr\",\"type\":\"aehvvibrxjjstoq\"}") - .toObject(WorkloadProfileStatesInner.class); - Assertions.assertEquals(1522179907, model.properties().minimumCount()); - Assertions.assertEquals(255034362, model.properties().maximumCount()); - Assertions.assertEquals(1064191938, model.properties().currentCount()); - } - - @Test - public void testSerialize() { - WorkloadProfileStatesInner model = - new WorkloadProfileStatesInner() - .withProperties( - new WorkloadProfileStatesProperties() - .withMinimumCount(1522179907) - .withMaximumCount(255034362) - .withCurrentCount(1064191938)); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesInner.class); - Assertions.assertEquals(1522179907, model.properties().minimumCount()); - Assertions.assertEquals(255034362, model.properties().maximumCount()); - Assertions.assertEquals(1064191938, model.properties().currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesPropertiesTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesPropertiesTests.java deleted file mode 100644 index 7fe7ba5a869bf..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileStatesPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfileStatesProperties; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkloadProfileStatesPropertiesTests { - @Test - public void testDeserialize() { - WorkloadProfileStatesProperties model = - BinaryData - .fromString("{\"minimumCount\":449265761,\"maximumCount\":774286462,\"currentCount\":1086468364}") - .toObject(WorkloadProfileStatesProperties.class); - Assertions.assertEquals(449265761, model.minimumCount()); - Assertions.assertEquals(774286462, model.maximumCount()); - Assertions.assertEquals(1086468364, model.currentCount()); - } - - @Test - public void testSerialize() { - WorkloadProfileStatesProperties model = - new WorkloadProfileStatesProperties() - .withMinimumCount(449265761) - .withMaximumCount(774286462) - .withCurrentCount(1086468364); - model = BinaryData.fromObject(model).toObject(WorkloadProfileStatesProperties.class); - Assertions.assertEquals(449265761, model.minimumCount()); - Assertions.assertEquals(774286462, model.maximumCount()); - Assertions.assertEquals(1086468364, model.currentCount()); - } -} diff --git a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileTests.java b/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileTests.java deleted file mode 100644 index 83588dd997c49..0000000000000 --- a/sdk/appcontainers/azure-resourcemanager-appcontainers/src/test/java/com/azure/resourcemanager/appcontainers/generated/WorkloadProfileTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.appcontainers.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.appcontainers.models.WorkloadProfile; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -public final class WorkloadProfileTests { - @Test - public void testDeserialize() { - WorkloadProfile model = - BinaryData - .fromString( - "{\"workloadProfileType\":\"wzjbh\",\"minimumCount\":1608749608,\"maximumCount\":1253939074}") - .toObject(WorkloadProfile.class); - Assertions.assertEquals("wzjbh", model.workloadProfileType()); - Assertions.assertEquals(1608749608, model.minimumCount()); - Assertions.assertEquals(1253939074, model.maximumCount()); - } - - @Test - public void testSerialize() { - WorkloadProfile model = - new WorkloadProfile() - .withWorkloadProfileType("wzjbh") - .withMinimumCount(1608749608) - .withMaximumCount(1253939074); - model = BinaryData.fromObject(model).toObject(WorkloadProfile.class); - Assertions.assertEquals("wzjbh", model.workloadProfileType()); - Assertions.assertEquals(1608749608, model.minimumCount()); - Assertions.assertEquals(1253939074, model.maximumCount()); - } -}